Anastasia added inline comments.

================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8263
+def err_atomic_init_addressspace : Error<
+  "initialization of atomic variables is restricted to variables in global 
address space">;
 def err_atomic_init_constant : Error<
----------------
Could we combine this error diag with the one below? I guess they are 
semantically very similar apart from one is about initialization and another is 
about assignment?


================
Comment at: lib/Sema/SemaInit.cpp:6498
+
+  if (S.getLangOpts().OpenCL && S.getLangOpts().OpenCLVersion >= 200 &&
+      ETy->isAtomicType() && !HasGlobalAS &&
----------------
I would remove S.getLangOpts().OpenCL check, it's redundant in my opinion!


================
Comment at: lib/Sema/SemaInit.cpp:6501
+      Entity.getKind() == InitializedEntity::EK_Variable && Args.size() > 0) {
+    const Expr *Init = Args[0];
+    S.Diag(Init->getLocStart(), diag::err_atomic_init_addressspace) <<
----------------
Even thought it's done above too, I don't really see the point of having this 
variable.


https://reviews.llvm.org/D30643



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to