[PATCH] [OPENMP] Initial codegen for '#pragma omp parallel'

Richard Smith richard at metafoo.co.uk
Sun Apr 13 18:25:19 PDT 2014


  LGTM, but this is a significant enough change to CodeGen that I'd like rjmccall to look at it too.


================
Comment at: lib/Serialization/ASTReaderDecl.cpp:1080-1088
@@ -1079,5 +1079,11 @@
   VisitDecl(CD);
+  unsigned ContextParamPos = Record[Idx++];
+  CD->setNothrow(Record[Idx++] != 0);
   // Body is set by VisitCapturedStmt.
-  for (unsigned i = 0; i < CD->NumParams; ++i)
-    CD->setParam(i, ReadDeclAs<ImplicitParamDecl>(Record, Idx));
+  for (unsigned i = 0; i < CD->NumParams; ++i) {
+    if (i != ContextParamPos)
+      CD->setParam(i, ReadDeclAs<ImplicitParamDecl>(Record, Idx));
+    else
+      CD->setContextParam(i, ReadDeclAs<ImplicitParamDecl>(Record, Idx));
+  }
 }
----------------
Alexey Bataev wrote:
> Richard Smith wrote:
> > Do you have test coverage for this?
> Yes, parallel_codegen.cpp and parallel_ast_print.cpp.
Do those really test the serialization/deserialization code?


http://reviews.llvm.org/D2883






More information about the cfe-commits mailing list