ABataev added inline comments.
================
Comment at: lib/Sema/SemaOpenMP.cpp:816-822
@@ -801,6 +815,9 @@
+
+ // A DSA refers to this captured region if the parent contexts match.
+ auto *ParentContext = RSI->TheCapturedDecl->getParent();
for (auto I = Stack.rbegin(), EE = Stack.rend(); I != EE; ++I)
- if (I->CurScope == S)
+ if (I->ParentDeclContext == ParentContext)
return I->Directive;
return OMPD_unknown;
}
----------------
Actually, I think, we need to rework the whole IsOpenMPCapturedByRef()
function. I'm not sure that it is even required. It looks like some
optimization hack in the frontend. I'm against any not-necessary optimizations
in frontend. If scalar value is a firstprivate, it must be handled in codegen,
not by handling it by copy.
http://reviews.llvm.org/D18110
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits