[PATCH] [OPENMP] Codegen for 'firstprivate' clause in 'for' directive.

John McCall rjmccall at gmail.com
Fri Apr 10 10:49:52 PDT 2015


================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:168
@@ -167,4 +167,3 @@
       return OuterRegionInfo->lookup(VD);
-    llvm_unreachable("Trying to reference VarDecl that is neither local nor "
-                     "captured in outer OpenMP region");
+    return nullptr;
   }
----------------
It's probably worth leaving a comment here describing the valid situations in which this can fail.

================
Comment at: lib/CodeGen/CGStmtOpenMP.cpp:159
@@ +158,3 @@
+      DeclRefExpr DRE(const_cast<VarDecl *>(OrigVD),
+                      CapturedStmtInfo->lookup(OrigVD) != nullptr,
+                      (*IRef)->getType(), VK_LValue, (*IRef)->getExprLoc());
----------------
This is the sort of place you should be using comments on arguments: something like /*refersToEnclosing*/ would be helpful here.

http://reviews.llvm.org/D8660

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list