summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2017-09-20 20:11:31 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2017-09-20 20:11:31 +0000
commite85de8fcf9c0ea5f878140c2801be67a3663a518 (patch)
tree0b91e1c72bdc972a21bbaeca07872c8c26283258 /clang/lib/AST
parent0f245eccd6244267f64785714ed274ed62540799 (diff)
downloadbcm5719-llvm-e85de8fcf9c0ea5f878140c2801be67a3663a518.tar.gz
bcm5719-llvm-e85de8fcf9c0ea5f878140c2801be67a3663a518.zip
[OPENMP] Support for re-declarations when checking captured variables.
Need to check for variables re-declarations when checking that the variable was already captured in the captured region. llvm-svn: 313805
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/Stmt.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index 2367cadf645..922ff1f8dea 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/lib/AST/Stmt.cpp
@@ -1114,11 +1114,7 @@ bool CapturedStmt::capturesVariable(const VarDecl *Var) const {
for (const auto &I : captures()) {
if (!I.capturesVariable() && !I.capturesVariableByCopy())
continue;
-
- // This does not handle variable redeclarations. This should be
- // extended to capture variables with redeclarations, for example
- // a thread-private variable in OpenMP.
- if (I.getCapturedVar() == Var)
+ if (I.getCapturedVar()->getCanonicalDecl() == Var->getCanonicalDecl())
return true;
}
OpenPOWER on IntegriCloud