[PATCH] D109609: [C++4OpenCL] Add support for multiple address spaced destructors

2021-09-17 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 373225. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109609/new/ https://reviews.llvm.org/D109609 Files: clang/include/clang/AST/DeclCXX.h clang/include/clang/Sema/Sema.h clang/lib/AST/DeclCXX.cpp clang/lib/Sema/SemaDeclCXX.cpp clang/lib

[PATCH] D109609: [C++4OpenCL] Add support for multiple address spaced destructors

2021-09-17 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm marked 2 inline comments as done. olestrohm added inline comments. Comment at: clang/lib/Sema/SemaLookup.cpp:3082 ID.AddInteger(VolatileThis); + ID.AddInteger((unsigned)AS); Anastasia wrote: > Btw ctors and assignments don't seem to need this but

[PATCH] D109609: [C++4OpenCL] Add support for multiple address spaced destructors

2021-09-17 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 373218. olestrohm added a comment. I made the implicit destructor always be created in __generic address space. I couldn't manage to properly figure a case that would trigger `LookupSpecialMember`, so I couldn't figure out how or if address spaces are hand

[PATCH] D107553: [C++4OpenCL] Initialize temporaries in the private address space

2021-09-13 Thread Ole Strohm via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8008009fd25b: [OpenCL] Initialize temporaries in the private address space (authored by olestrohm). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107553/new/

[PATCH] D109609: [C++4OpenCL] Add support for multiple address spaced destructors

2021-09-10 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh, rjmccall. olestrohm added a project: clang. Herald added subscribers: ldrumm, yaxunl. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. This patch aims to add initial support for multi

[PATCH] D109526: [OpenCL][Docs] Added ref to libclcxx

2021-09-09 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm accepted this revision. olestrohm added a comment. This revision is now accepted and ready to land. Looks good! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109526/new/ https://reviews.llvm.org/D109526 ___ cfe-commits mailing list

[PATCH] D107553: [C++4OpenCL] Initialize temporaries in the private address space

2021-08-19 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 367455. olestrohm added a comment. I made the check into an assert as suggested. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107553/new/ https://reviews.llvm.org/D107553 Files: clang/include/clang/Sema/Initialization.h clang/lib/Sema/SemaEx

[PATCH] D107553: [C++4OpenCL] Initialize temporaries in the private address space

2021-08-05 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, rjmccall. olestrohm added a project: clang. Herald added subscribers: ldrumm, yaxunl. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. This patch fixes initializing temporaries, which are cur

[PATCH] D102689: [C++] Ignore top-level qualifiers in casts

2021-07-05 Thread Ole Strohm via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG85255a04e572: [C++][Sema] Ignore top-level qualifiers in casts (authored by olestrohm). Changed prior to commit: https://reviews.llvm.org/D102689?

[PATCH] D103962: [C++4OpenCL] Fix qualifiers check on binding references to temporaries

2021-06-29 Thread Ole Strohm via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG78d309ce197c: [OpenCL] Fix qualifiers check on binding references to temporaries (authored by olestrohm). Repository: rG LLVM Github Monorepo CHA

[PATCH] D102850: [C++4OpenCL] Fix overloading resolution of addrspace constructors

2021-06-11 Thread Ole Strohm via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb102e6880ab0: [OpenCL] Fix overloading resolution of addrspace constructors (authored by olestrohm). Changed prior to commit: https://reviews.llvm.org/D102850?vs=351165&id=351388#toc Repository: rG L

[PATCH] D102850: [C++4OpenCL] Fix overloading resolution of addrspace constructors

2021-06-10 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 351165. olestrohm added a comment. Added a comment explaining what the check is meant for. Also added a `CHECK-NOT: used` to properly test that the __generic constructor is not used. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102850/new/ http

[PATCH] D103252: [C++4OpenCL] Fix missing address space on implicit move assignment operator

2021-06-10 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added inline comments. Comment at: clang/test/AST/ast-dump-implicit-members.clcpp:10 + +// CHECK: CXXConstructorDecl {{.*}} implicit used constexpr S 'void () __generic noexcept' +// CHECK: CXXConstructorDecl {{.*}} implicit constexpr S 'void (const __generic S &) __g

[PATCH] D103962: [C++4OpenCL] Fix qualifiers check on binding references to temporaries

2021-06-09 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh. olestrohm added a project: clang. Herald added subscribers: ldrumm, yaxunl. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. Fixing the qualifiers check from PR49733. It would be gre

[PATCH] D102689: [C++] Ignore top-level qualifiers in casts

2021-06-09 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added inline comments. Comment at: clang/test/SemaCXX/warn-reinterpret-base-class.cpp:301 - // expected-warning@+2 {{'reinterpret_cast' to class 'L' (aka 'const F *volatile') from its base at non-zero offset 'E *' behaves differently from 'static_cast'}} + // expe

[PATCH] D102850: [C++4OpenCL] Fix overloading resolution of addrspace constructors

2021-06-08 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 350561. olestrohm added a comment. I've reverted to using Constructors and prioritizing based on which constructor is the most qualified. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102850/new/ https://reviews.llvm.org/D102850 Files: clang/l

[PATCH] D102689: [C++] Ignore top-level qualifiers in casts

2021-06-08 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 350560. olestrohm retitled this revision from "[C++4OpenCL] Allow address space conversion in reinterpret_cast" to "[C++] Ignore top-level qualifiers in casts". olestrohm edited the summary of this revision. olestrohm added a comment. I've added a check in

[PATCH] D103252: [C++4OpenCL] Fix missing address space on implicit move assignment operator

2021-06-07 Thread Ole Strohm via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG438cf5577e72: [OpenCL] Fix missing addrspace on implicit move assignment operator (authored by olestrohm). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1032

[PATCH] D103252: [C++4OpenCL] Fix missing address space on implicit move assignment operator

2021-06-01 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 348969. olestrohm added a comment. Cleaned up the test by renaming the struct and making the test compile. The test has also been moved to `clang/test/AST` as suggested, since it really just makes sure that the generated AST contains the correct implicit me

[PATCH] D103175: [C++4OpenCL] Fix ICE with invalid use of half

2021-06-01 Thread Ole Strohm via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG94b0aec0f5c6: [OpenCL] Fix ICE with invalid use of half (authored by olestrohm). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D102689: [C++4OpenCL] Allow address space conversion in reinterpret_cast

2021-06-01 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added inline comments. Comment at: clang/lib/Sema/SemaCast.cpp:2359 - if (SrcType == DestType) { + if (SrcType == Self.Context.removeAddrSpaceQualType(DestType)) { // C++ 5.2.10p2 has a note that mentions that, subject to all other rjmccall wro

[PATCH] D103252: [C++4OpenCL] Fix missing address space on implicit move assignment operator

2021-05-27 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh. olestrohm added a project: clang. Herald added subscribers: ldrumm, yaxunl. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. This fixes the missing address space on `this` in the impl

[PATCH] D103175: [C++4OpenCL] Fix ICE with invalid use of half

2021-05-26 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh. olestrohm added a project: clang. Herald added subscribers: ldrumm, yaxunl. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. Because half is limited to the `cl_khr_fp16` extension bei

[PATCH] D102689: [C++4OpenCL] Allow address space conversion in reinterpret_cast

2021-05-26 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 347922. olestrohm added a comment. I've cleaned up the check. The qualifiers of SrcType are removed prior to this function, so only DestType needs to have the address space removed. reinterpret_cast only allows integral types, so structs are not an issue h

[PATCH] D102850: [C++4OpenCL] Fix overloading resolution of addrspace constructors

2021-05-26 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:9870 + if (S.getLangOpts().OpenCL) { +if (const auto *CD1 = dyn_cast_or_null(Cand1.Function)) { Anastasia wrote: > olestrohm wrote: > > Anastasia wrote: > > > olestrohm wrote: >

[PATCH] D102850: [C++4OpenCL] Fix overloading resolution of addrspace constructors

2021-05-26 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 347872. olestrohm added a comment. Made the check more general, it's no longer OpenCL specific and no longer restricted to just constructors, since the check only requires them to be methods. Also added more Sema tests, including using FileCheck to check

[PATCH] D102850: [C++4OpenCL] Fix overloading resolution of addrspace constructors

2021-05-24 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:9870 + if (S.getLangOpts().OpenCL) { +if (const auto *CD1 = dyn_cast_or_null(Cand1.Function)) { Anastasia wrote: > olestrohm wrote: > > Anastasia wrote: > > > I think we should r

[PATCH] D102850: [C++4OpenCL] Fix overloading resolution of addrspace constructors

2021-05-24 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:9870 + if (S.getLangOpts().OpenCL) { +if (const auto *CD1 = dyn_cast_or_null(Cand1.Function)) { Anastasia wrote: > I think we should remove the OpenCL check since it is not OpenC

[PATCH] D102850: [C++4OpenCL] Allow address space conversion in reinterpret_cast

2021-05-20 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh. olestrohm added a project: clang. Herald added subscribers: ldrumm, yaxunl. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. This fixes the prioritization of address spaces when choos

[PATCH] D102689: [C++4OpenCL] Allow address space conversion in reinterpret_cast

2021-05-18 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, rjmccall. olestrohm added a project: clang. Herald added subscribers: ldrumm, yaxunl. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. Allow converting between types with different address sp

[PATCH] D102248: [C++4OpenCL] Fix initialization of __constant constructors without arguments

2021-05-18 Thread Ole Strohm via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG642d2f000b26: [OpenCL] Fix initialization of __constant constructors without arguments (authored by olestrohm). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D102248: [C++4OpenCL] Fix initialization of __constant constructors without arguments

2021-05-17 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 345845. olestrohm added a comment. Relaxed the checks in the codegen test because of failures on platforms with slightly different IR being generated. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102248/new/ https://reviews.llvm.org/D102248 Fil

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors

2021-05-17 Thread Ole Strohm via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG66b112d624a5: [OpenCL] Fix reinterpret_cast of vectors (authored by olestrohm). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101519/new/ https://reviews.ll

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors

2021-05-14 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 345442. olestrohm added a comment. Fixed the code style and added some comments to the tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101519/new/ https://reviews.llvm.org/D101519 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/Sem

[PATCH] D102248: [C++4OpenCL] Fix initialization of __constant constructors without arguments

2021-05-14 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 345436. olestrohm added a comment. Added a codegen test and clarified what some parts are testing. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102248/new/ https://reviews.llvm.org/D102248 Files: clang/lib/Sema/SemaDecl.cpp clang/test/CodeGe

[PATCH] D102248: [C++4OpenCL] Fix initialization of __constant constructors without arguments

2021-05-12 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added inline comments. Comment at: clang/test/SemaOpenCLCXX/addrspace-constructors.clcpp:36 + Z() __local = default; + Z() __global = default; + constexpr Z() __constant : z(0) {} Anastasia wrote: > We seem to be missing the coverage with __constant

[PATCH] D102248: [C++4OpenCL] Fix initialization of __constant constructors without arguments

2021-05-11 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh. olestrohm added a project: clang. Herald added subscribers: ldrumm, yaxunl. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. This fixes the implicit initialization that uses construct

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors

2021-05-11 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 344408. olestrohm added a comment. I tried to add a special case for 3 and 4 element vectors, but that caused issues in codgen, so I've left it as a FIXME for now. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101519/new/ https://reviews.llvm.org

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors

2021-05-07 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 343647. olestrohm retitled this revision from "[C++4OpenCL] Fix reinterpret_cast of vectors and types with address spaces" to "[C++4OpenCL] Fix reinterpret_cast of vectors". olestrohm set the repository for this revision to rG LLVM Github Monorepo. olestroh

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors and types with address spaces

2021-04-30 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added inline comments. Comment at: clang/test/SemaOpenCLCXX/reinterpret-cast.clcpp:1 +// RUN: %clang_cc1 %s -pedantic -verify -fsyntax-only + Anastasia wrote: > Btw I assume your patch also allows reinterpret_cast between vectors? What > happens if we

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors and types with address spaces

2021-04-30 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 341844. olestrohm added a comment. Fixed formatting. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101519/new/ https://reviews.llvm.org/D101519 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCast.cpp clang/lib/Sema/SemaExpr.cpp

[PATCH] D101168: [C++4OpenCL] Add clang extension for non-portable kernel parameters

2021-04-30 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 341831. olestrohm added a comment. Fixed merge error CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101168/new/ https://reviews.llvm.org/D101168 Files: clang/docs/LanguageExtensions.rst clang/include/clang/Basic/OpenCLExtensions.def clang/li

[PATCH] D101168: [C++4OpenCL] Add clang extension for non-portable kernel parameters

2021-04-29 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 341526. olestrohm set the repository for this revision to rG LLVM Github Monorepo. olestrohm added a comment. Added a link to the C++ for OpenCL specification and cleaned up the text according to the requests. Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors and types with address spaces

2021-04-29 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh. olestrohm added a project: clang. Herald added subscribers: ldrumm, yaxunl. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. This fixes two issues with reinterpret_cast in C++ for Ope

[PATCH] D101168: [C++4OpenCL] Add clang extension for unsafe kernel parameters

2021-04-27 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 340796. olestrohm added a comment. Improved the description and example per the feedback. The check for dependent type is needed. If it is not included the diagnostic will get triggered when the extension is disabled, but not when it's enabled. CHANGES S

[PATCH] D101168: [C++4OpenCL] Add clang extension for unsafe kernel parameters

2021-04-27 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:8651 static OpenCLParamType getOpenCLKernelParameterType(Sema &S, QualType PT) { + if (PT->isDependentType()) +return InvalidKernelParam; Anastasia wrote: > I would rather add an asser

[PATCH] D101168: [C++4OpenCL] Add clang extension for unsafe kernel parameters

2021-04-23 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh. olestrohm added a project: clang. Herald added subscribers: ldrumm, kerbowa, jfb, yaxunl, nhaehnle, jvesely, jholewinski. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. This featur

[PATCH] D100860: [C++4OpenCL] Add missing OpenCL specific diagnostics in templates

2021-04-23 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 339976. olestrohm added a comment. I noticed that I could move the new check above the diagnostic for program scope variables, and the check during parsing can then be removed, while maintaining good diagnostics. This does change the diagnostic for `event

[PATCH] D100860: [C++4OpenCL] Add missing OpenCL specific diagnostics in templates

2021-04-22 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added a comment. The only ones that change (in the test cases at least) are as follows: Here Old is with the current change, and New is with the call to `diagnoseOpenCLTypes` at parsing removed. In `event_t.cl`, `event_t glb_evt;` in program scope has this difference: Old: the '

[PATCH] D100860: [C++4OpenCL] Add missing OpenCL specific diagnostics in templates

2021-04-21 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 339251. olestrohm added a comment. Renamed test as suggested. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100860/new/ https://reviews.llvm.org/D100860 Files: clang/lib/Sema/SemaDecl.cpp clang/test/SemaOpenCL/clk_event_t.cl clang/test/Sema

[PATCH] D100860: [C++4OpenCL] Add missing OpenCL specific diagnostics in templates

2021-04-21 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 339197. olestrohm added a comment. Ran git-clang-format. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100860/new/ https://reviews.llvm.org/D100860 Files: clang/lib/Sema/SemaDecl.cpp clang/test/SemaOpenCL/clk_event_t.cl clang/test/SemaOpenC

[PATCH] D100860: [C++4OpenCL] Add missing OpenCL specific diagnostics in templates

2021-04-21 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 339175. olestrohm added a comment. Inlined the `thread_local` check and moved `static clk_event_t` into the appropriate test. I did not move the `thread_local` check since NewVD had the wrong value for `TSCS`, so D was required. CHANGES SINCE LAST ACTION

[PATCH] D100860: [C++4OpenCL] Add missing OpenCL specific diagnostics in templates

2021-04-20 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh. Herald added subscribers: ldrumm, wenlei, yaxunl. olestrohm requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. For templates diagnosis must be done after specializa

[PATCH] D100471: [C++4OpenCL] Add extra diagnostics for kernel argument types

2021-04-16 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 338032. olestrohm set the repository for this revision to rG LLVM Github Monorepo. olestrohm added a comment. Restricted the checks to C++ for OpenCL and added another test for OpenCL vector types. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D100471: [C++4OpenCL] Add extra diagnostics for kernel argument types

2021-04-15 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:8673 +// reference if an implementation supports them in kernel parameters. +if (!PointeeType->isAtomicType() && !PointeeType->isVoidType() && +!PointeeType->isStandardLayoutType()) -

[PATCH] D100471: [C++4OpenCL] Add extra diagnostics for kernel argument types

2021-04-14 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 337450. olestrohm added a comment. Added more exhaustive tests, as well as fixed the diagnostic to allow reference types. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100471/new/ https://reviews.llvm.org/D100471 Files: clang/lib/Sema/SemaDecl

[PATCH] D100471: [C++4OpenCL] Add extra diagnostics for kernel argument types

2021-04-14 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh. olestrohm added a project: clang. Herald added subscribers: ldrumm, jfb, yaxunl. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. Adds extra error diagnostics when using unsupported t

[PATCH] D85429: [OpenCL] Allow for variadic macros in C++ for OpenCL

2020-08-07 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 283909. olestrohm added a comment. I have amended the relevant test to validate this behaviour in C++ for OpenCL. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85429/new/ https://reviews.llvm.org/D85429 Files: clang/lib/Lex/PPDirectives.cpp c

[PATCH] D85429: [OpenCL] Allow for variadic macros in C++ for OpenCL

2020-08-06 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added a reviewer: Anastasia. olestrohm added a project: clang. Herald added subscribers: cfe-commits, yaxunl. olestrohm requested review of this revision. C++ for OpenCL intends to support variadic macros, a decision motivated by OpenCL 3.0. This patch s

[PATCH] D83665: [OpenCL] Fixed missing address space for templated copy constructor

2020-07-21 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 279485. olestrohm added a comment. The code now directly adds the __generic address space to the pointee type. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83665/new/ https://reviews.llvm.org/D83665 Files: clang/lib/Sema/SemaTemplateDeduction.

[PATCH] D83665: [OpenCL] Fixed missing address space for templated copy constructor

2020-07-20 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm marked an inline comment as done. olestrohm added inline comments. Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:3811 + if(S.getLangOpts().OpenCL) +ArgType = S.deduceOpenCLPointeeAddrSpace(ArgType); ArgType = S.Context.getLValueReferenceType(A

[PATCH] D83665: [OpenCL] Fixed missing address space for templated copy constructor

2020-07-13 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, rjmccall. olestrohm added a project: clang. Herald added subscribers: cfe-commits, yaxunl. When you have a templated constructor with an R-value reference the compiler implicitly creates a copy and move constructor through the

[PATCH] D82781: [OpenCL] Fix missing address space deduction in template variables

2020-07-08 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 276369. olestrohm marked an inline comment as done. olestrohm added a comment. I've removed the comments calling for a fix because I no longer feel that this approach needs that. Given the code that already exists, and without changing too much of it, addi

[PATCH] D82781: [OpenCL] Fix missing address space deduction in template variables

2020-07-03 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 275381. olestrohm added a comment. I have added a check in `deduceOpenCLAddressSpace()` to check if the type is dependent, and not deduce the address space if it is. This is a big change in the behaviour of address space deduction, meaning that template va

[PATCH] D82781: [OpenCL] Fix missing address space deduction in template variables

2020-07-03 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 275351. olestrohm added a comment. Disregard the last comment, rolling back that diff for now. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82781/new/ https://reviews.llvm.org/D82781 Files: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp clan

[PATCH] D82781: [OpenCL] Fix missing address space deduction in template variables

2020-07-03 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 275345. olestrohm added a comment. Added a guard in deduceOpenCLAddressSpace to stop it from deducing address space for dependent types, as requested. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82781/new/ https://reviews.llvm.org/D82781 Files

[PATCH] D82781: [OpenCL] Fix missing address space deduction in template variables

2020-06-30 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added a comment. Essentially, in each pass the type for the variable starts off being extract from the SourceTypeInfo, but since the address space isn't specified, this type is then missing an address space. Adding the address space deduction then reintroduces the address space to the

[PATCH] D82781: [OpenCL] Fix missing address space deduction in template variables

2020-06-29 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, rjmccall. olestrohm added a project: clang. Herald added a subscriber: yaxunl. This patch fixes two instances of not deducing address spaces for global template variables. I've added OpenCL address space deduction to the funct