diff options
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index f40dd086481..93984e619bd 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -2782,21 +2782,11 @@ void CallArgList::allocateArgumentMemory(CodeGenFunction &CGF) { // alloca and store lazily on the first cleanup emission. StackBaseMem = CGF.CreateTempAlloca(CGF.Int8PtrTy, "inalloca.spmem"); CGF.Builder.CreateStore(StackBase, StackBaseMem); - CGF.pushStackRestore(EHCleanup, StackBaseMem); + CGF.pushStackRestore(NormalCleanup, StackBaseMem); StackCleanup = CGF.EHStack.getInnermostEHScope(); assert(StackCleanup.isValid()); } -void CallArgList::freeArgumentMemory(CodeGenFunction &CGF) const { - if (StackBase) { - CGF.DeactivateCleanupBlock(StackCleanup, StackBase); - llvm::Value *F = CGF.CGM.getIntrinsic(llvm::Intrinsic::stackrestore); - // We could load StackBase from StackBaseMem, but in the non-exceptional - // case we can skip it. - CGF.Builder.CreateCall(F, StackBase); - } -} - void CodeGenFunction::EmitNonNullArgCheck(RValue RV, QualType ArgType, SourceLocation ArgLoc, const FunctionDecl *FD, @@ -3533,10 +3523,6 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, if (CallArgs.hasWritebacks()) emitWritebacks(*this, CallArgs); - // The stack cleanup for inalloca arguments has to run out of the normal - // lexical order, so deactivate it and run it manually here. - CallArgs.freeArgumentMemory(*this); - RValue Ret = [&] { switch (RetAI.getKind()) { case ABIArgInfo::InAlloca: |