summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2014-05-14 10:40:54 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2014-05-14 10:40:54 +0000
commit301a2d9249b61510f827ffb9413b08845fff1121 (patch)
tree6c3fd52ad804b9f0f547d4145eb0f225a7fb8632
parentaaf4bb239487e0a3b20a8eaf94fc641235ba2c29 (diff)
downloadbcm5719-llvm-301a2d9249b61510f827ffb9413b08845fff1121.tar.gz
bcm5719-llvm-301a2d9249b61510f827ffb9413b08845fff1121.zip
[OPENMP] Fix warning in Release builds.
llvm-svn: 208768
-rw-r--r--clang/lib/Sema/SemaStmt.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 056b93dc86e..d398f7b12d2 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -3412,6 +3412,15 @@ void Sema::ActOnCapturedRegionStart(SourceLocation Loc, Scope *CurScope,
}
}
assert(ContextIsFound && "no null type for '__context' parameter");
+ if (!ContextIsFound) {
+ // Add __context implicitly if it is not specified.
+ IdentifierInfo *ParamName = &Context.Idents.get("__context");
+ QualType ParamType = Context.getPointerType(Context.getTagDeclType(RD));
+ ImplicitParamDecl *Param =
+ ImplicitParamDecl::Create(Context, DC, Loc, ParamName, ParamType);
+ DC->addDecl(Param);
+ CD->setContextParam(ParamNum, Param);
+ }
// Enter the capturing scope for this captured region.
PushCapturedRegionScope(CurScope, CD, RD, Kind);
OpenPOWER on IntegriCloud