jdoerfert added inline comments.

================
Comment at: clang/lib/CodeGen/CGDecl.cpp:2618
+void CodeGenModule::EmitOMPAllocateDecl(const OMPAllocateDecl *D) {
+  for (Expr *E : const_cast<OMPAllocateDecl *>(D)->varlists()) {
+    auto *DE = cast<DeclRefExpr>(E);
----------------
ABataev wrote:
> Why need to remove constantness here?
The problem is that the declaration, which might have been already generated in 
IR or not, had no address space attached before. Now we want to do that after 
the fact, potentially *way later*. To reuse the general codegen mechanism I 
modify the VarDecl (temporarily) by attaching the new address space and calling 
codegen again. If you have a better idea, I'm happy to change this.


================
Comment at: clang/lib/CodeGen/CGDecl.cpp:2623-2624
+    // Skipp all but globals.
+    if (!VD->hasGlobalStorage())
+      continue;
+
----------------
ABataev wrote:
> What about static locals, will it work?
need to check, will add a test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101030/new/

https://reviews.llvm.org/D101030

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

Reply via email to