summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-04-27 07:56:03 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-04-27 07:56:03 +0000
commit4ba78a46ff760b254d4853e676e12ce35b4f65ac (patch)
treedf50a2666cd6cc7703443edffa600a505ae78f65 /clang/lib/CodeGen/CodeGenFunction.h
parenta2d72377a111b96f22b780e0573bbc79fe005729 (diff)
downloadbcm5719-llvm-4ba78a46ff760b254d4853e676e12ce35b4f65ac.tar.gz
bcm5719-llvm-4ba78a46ff760b254d4853e676e12ce35b4f65ac.zip
[OPENMP] Fix for codegen of captured variables in inlined directives.
Currently there is a problem with codegen of inlined directives inside lambdas, it may cause a crash during codegen because of incorrect capturing of variables. Patch fixes this problem. llvm-svn: 267677
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 148a9453f6c..8c725e267df 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -641,6 +641,11 @@ public:
ForceCleanup();
}
+ /// Checks if the global variable is captured in current function.
+ bool isGlobalVarCaptured(const VarDecl *VD) const {
+ return !VD->isLocalVarDeclOrParm() && CGF.LocalDeclMap.count(VD) > 0;
+ }
+
private:
/// Copy all the entries in the source map over the corresponding
/// entries in the destination, which must exist.
OpenPOWER on IntegriCloud