From 3390ed3341a0848f37333d55bb34bcff4b9364c2 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 14 May 2014 10:40:54 +0000 Subject: [PATCH] [OPENMP] Fix warning in Release builds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208768 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaStmt.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 056b93dc86..d398f7b12d 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/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); -- 2.40.0