diff options
author | Tim Shen <timshen91@gmail.com> | 2016-06-09 21:13:39 +0000 |
---|---|---|
committer | Tim Shen <timshen91@gmail.com> | 2016-06-09 21:13:39 +0000 |
commit | 17b3deeff3f0b246789c37911a445dbd4ad3456f (patch) | |
tree | e03729ec0980541f07ba560ef329fb47b3443254 /clang/lib/Sema/SemaLambda.cpp | |
parent | ee2ce4a50e16548cd4274e8532491cc8b06d7a8d (diff) | |
download | bcm5719-llvm-17b3deeff3f0b246789c37911a445dbd4ad3456f.tar.gz bcm5719-llvm-17b3deeff3f0b246789c37911a445dbd4ad3456f.zip |
Revert "[Temporary] Add an ExprWithCleanups for each C++ MaterializeTemporaryExpr."
This reverts r272296, since there are clang-tidy failures that appear to
be caused by this change.
llvm-svn: 272310
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-rw-r--r-- | clang/lib/Sema/SemaLambda.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index ae768b62677..d1d002b5d41 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -1500,7 +1500,7 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, SourceRange IntroducerRange; bool ExplicitParams; bool ExplicitResultType; - CleanupInfo LambdaCleanup; + bool LambdaExprNeedsCleanups; bool ContainsUnexpandedParameterPack; SmallVector<VarDecl *, 4> ArrayIndexVars; SmallVector<unsigned, 4> ArrayIndexStarts; @@ -1510,7 +1510,7 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, IntroducerRange = LSI->IntroducerRange; ExplicitParams = LSI->ExplicitParams; ExplicitResultType = !LSI->HasImplicitReturnType; - LambdaCleanup = LSI->Cleanup; + LambdaExprNeedsCleanups = LSI->ExprNeedsCleanups; ContainsUnexpandedParameterPack = LSI->ContainsUnexpandedParameterPack; CallOperator->setLexicalDeclContext(Class); @@ -1591,8 +1591,9 @@ ExprResult Sema::BuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, CheckCompletedCXXClass(Class); } - Cleanup.mergeFrom(LambdaCleanup); - + if (LambdaExprNeedsCleanups) + ExprNeedsCleanups = true; + LambdaExpr *Lambda = LambdaExpr::Create(Context, Class, IntroducerRange, CaptureDefault, CaptureDefaultLoc, Captures, @@ -1713,7 +1714,7 @@ ExprResult Sema::BuildBlockForLambdaConversion(SourceLocation CurrentLocation, // Create the block literal expression. Expr *BuildBlock = new (Context) BlockExpr(Block, Conv->getConversionType()); ExprCleanupObjects.push_back(Block); - Cleanup.setExprNeedsCleanups(true); + ExprNeedsCleanups = true; return BuildBlock; } |