summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2013-03-16 04:47:38 +0000
committerManman Ren <mren@apple.com>2013-03-16 04:47:38 +0000
commitc089074aa57af8cb9cbef1ba351e828c46bab603 (patch)
treeed80b5b100b6872c2e1aecf938819dccd4334484 /clang/lib/CodeGen/CGCall.cpp
parent612f7bfa4dddf8521663d8e9a60132f1dd5d3e0b (diff)
downloadbcm5719-llvm-c089074aa57af8cb9cbef1ba351e828c46bab603.tar.gz
bcm5719-llvm-c089074aa57af8cb9cbef1ba351e828c46bab603.zip
revert r177211 due to its potential issues
llvm-svn: 177222
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 6438ebf846d..9e97bce6c3e 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1705,18 +1705,6 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI) {
llvm_unreachable("Invalid ABI kind for return argument");
}
- // If this function returns 'this' and the last instruction is a CallInst
- // that returns 'this', use the return value from the CallInst. We will not
- // need to keep 'this' alive through the callsite. It also enables
- // optimizations in the backend, such as tail call optimization.
- if (CalleeWithThisReturn && CGM.getCXXABI().HasThisReturn(CurGD)) {
- llvm::BasicBlock *IP = Builder.GetInsertBlock();
- llvm::CallInst *Callsite;
- if (!IP->empty() && (Callsite = dyn_cast<llvm::CallInst>(&IP->back())) &&
- Callsite->getCalledFunction() == CalleeWithThisReturn)
- // Create a bitcast of Callsite.
- RV = Builder.CreateBitCast(Callsite, RetAI.getCoerceToType());
- }
llvm::Instruction *Ret = RV ? Builder.CreateRet(RV) : Builder.CreateRetVoid();
if (!RetDbgLoc.isUnknown())
Ret->setDebugLoc(RetDbgLoc);
OpenPOWER on IntegriCloud