[PATCH] [OPENMP] Codegen for 'omp master' directive

John McCall rjmccall at gmail.com
Tue Dec 2 11:12:02 PST 2014

Generally looks good.  A few comments.

Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:685
@@ +684,3 @@
+    MasterOpGen();
+    // Build a call to __kmpc_end_master
+    RTLFn = CreateRuntimeFunction(OMPRTL__kmpc_end_master);
Please add a comment here that it's illegal to branch in or out of the master block — which I assume you're enforcing in Sema somehow — so you can just call __kmpc_end_master on fallthrough rather than pushing a normal cleanup for it.

Comment at: lib/CodeGen/CGOpenMPRuntime.h:101
@@ -98,1 +100,3 @@
+    // Call to void __kmpc_end_master(ident_t *, kmp_int32 global_tid);
+    OMPRTL__kmpc_end_master
Please leave a trailing comma on the last enumerator.  Makes a minor improvement to diffs.


More information about the cfe-commits mailing list