[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 3 09:45:11 PDT 2021


ABataev 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);
----------------
Why need to remove constantness here?


================
Comment at: clang/lib/CodeGen/CGDecl.cpp:2622
+
+    // Skipp all but globals.
+    if (!VD->hasGlobalStorage())
----------------
`Skip`


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


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101030



More information about the cfe-commits mailing list