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
Anastasia added a comment.
LGTM! Thanks!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102248/new/
https://reviews.llvm.org/D102248
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
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
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.
LGTM! Thanks!
Comment at: clang/test/CodeGenOpenCLCXX/addrspace-constructors.clcpp:22
+
+// CHECK: @cx1 = dso_local addrspace(2) constant %struct.X zeroinitializer,
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
Anastasia added inline comments.
Comment at: clang/test/SemaOpenCLCXX/addrspace-constructors.clcpp:36
+ Z() __local = default;
+ Z() __global = default;
+ constexpr Z() __constant : z(0) {}
olestrohm wrote:
> Anastasia wrote:
> > We seem to be missing the
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
Anastasia added inline comments.
Comment at: clang/lib/Sema/SemaDecl.cpp:12643
+ if (CXXRecordDecl *RD = Var->getType()->getAsCXXRecordDecl()) {
+for (auto *ctor : RD->ctors()) {
+ if (ctor->isConstexpr() && ctor->getNumParams() == 0 &&
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