This revision was automatically updated to reflect the committed changes.
Closed by commit rL338743: __c11_atomic_loads _Atomic can be const
(authored by jfb, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
https://reviews.llvm.org/D47618
Files:
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.
LGTM from OpenCL side! Thanks!
Repository:
rC Clang
https://reviews.llvm.org/D47618
___
cfe-commits mailing list
jfb marked an inline comment as done.
jfb added a comment.
Give the comments, I think this is ready to commit.
Repository:
rC Clang
https://reviews.llvm.org/D47618
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
jfb updated this revision to Diff 157761.
jfb added a comment.
- Add constant AS pointer test.
Repository:
rC Clang
https://reviews.llvm.org/D47618
Files:
lib/Sema/SemaChecking.cpp
test/Sema/atomic-ops.c
test/SemaOpenCL/atomic-ops.cl
Index: test/SemaOpenCL/atomic-ops.cl
Anastasia added inline comments.
Comment at: test/SemaOpenCL/atomic-ops.cl:61
__opencl_atomic_load(d, memory_order_seq_cst, memory_scope_work_group);
- __opencl_atomic_load(ci, memory_order_seq_cst, memory_scope_work_group); //
expected-error {{address argument to atomic
yaxunl added inline comments.
Comment at: lib/Sema/SemaChecking.cpp:3368-3374
} else if (Form != Load && Form != LoadCopy) {
if (ValType.isConstQualified()) {
Diag(DRE->getLocStart(), diag::err_atomic_op_needs_non_const_pointer)
<< Ptr->getType() <<
jfb added a subscriber: yaxunl.
jfb added inline comments.
Comment at: lib/Sema/SemaChecking.cpp:3361
+if ((Form != Load && Form != LoadCopy && AtomTy.isConstQualified()) ||
AtomTy.getAddressSpace() == LangAS::opencl_constant) {
Diag(DRE->getLocStart(),
rsmith added a comment.
We need to figure out what should happen in the OpenCL case, but the rest seems
fine.
Comment at: lib/Sema/SemaChecking.cpp:3360
}
-if (AtomTy.isConstQualified() ||
+if ((Form != Load && Form != LoadCopy && AtomTy.isConstQualified()) ||
jfb added a comment.
Note that I don't touch the OpenCL __constant stuff, because the separate
address space means this can be actually read-only, which means you can't
cmpxchg for very wide reads.
Repository:
rC Clang
https://reviews.llvm.org/D47618
jfb created this revision.
jfb added a reviewer: rsmith.
Herald added a subscriber: cfe-commits.
C++11 onwards specs the non-member functions atomic_load and
atomic_load_explicit as taking the atomic by const (potentially volatile)
pointer. C11, in its infinite wisdom, decided to drop the
10 matches
Mail list logo