[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-08-02 Thread JF Bastien via Phabricator via cfe-commits
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:

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-07-31 Thread Anastasia Stulova via Phabricator via cfe-commits
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

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-07-27 Thread JF Bastien via Phabricator via cfe-commits
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

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-07-27 Thread JF Bastien via Phabricator via cfe-commits
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

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-07-27 Thread Anastasia Stulova via Phabricator via cfe-commits
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

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-07-23 Thread Yaxun Liu via Phabricator via cfe-commits
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() <<

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-07-19 Thread JF Bastien via Phabricator via cfe-commits
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(),

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-06-11 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
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()) ||

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-05-31 Thread JF Bastien via Phabricator via cfe-commits
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

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-05-31 Thread JF Bastien via Phabricator via cfe-commits
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