sfantao added a comment.

Thanks for the fix!


================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:4257
@@ +4256,3 @@
+hasEnclosingTeams(const Stmt *TargetBody) {
+  if(auto *TeamsDir = dyn_cast<OMPTeamsDirective>(TargetBody)) return TeamsDir;
+
----------------
I think that this can be simplified to:

```
while (auto *S = dyn_cast<CompoundStmt>(TargetBody))
  TargetBody = S->body_front();

return dyn_cast<CompoundStmt>(OMPTeamsDirective);
```

I know that this is currently used only for teams, but I think it would be nice 
to make this a templated function to look for other possible nests. I suspect 
this will very useful for other cases like 'target teams parallel distribute'.


Repository:
  rL LLVM

http://reviews.llvm.org/D18474



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to