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

Alexey Bataev a.bataev at hotmail.com
Sun Apr 13 19:34:17 PDT 2014



================
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));
+  }
 }
----------------
Richard Smith wrote:
> 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?
Yes, take a look at these tests. There are 3 passes: 1) initial test "as is"; 2) "-emit-pch" pass; 3) "-include-pch" pass. The 2-nd and the 3-rd passes check serialization/deserialization of AST nodes.


http://reviews.llvm.org/D2883






More information about the cfe-commits mailing list