summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2009-02-04 22:54:57 +0000
committerTanya Lattner <tonic@nondot.org>2009-02-04 22:54:57 +0000
commit8920fde380f2898b6da4274a444da2b97bde1c2b (patch)
treeb40015f8c4d9d23c5e529466e0c06d033b352aff
parent597ba6f9f37fcdef77395feff63788d922b2b2c9 (diff)
downloadllvm-8920fde380f2898b6da4274a444da2b97bde1c2b.tar.gz
Merge from mainline.
Revert r63600. llvm-svn: 63787
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp9
-rw-r--r--llvm/test/Transforms/Inline/2009-02-02-InvokeUpdateCG.ll32
2 files changed, 2 insertions, 39 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index eb136b503497..758b97ea9154 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -41,8 +41,7 @@ bool llvm::InlineFunction(InvokeInst *II, CallGraph *CG, const TargetData *TD) {
/// block of the inlined code (the last block is the end of the function),
/// and InlineCodeInfo is information about the code that got inlined.
static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock,
- ClonedCodeInfo &InlinedCodeInfo,
- CallGraph *CG) {
+ ClonedCodeInfo &InlinedCodeInfo) {
BasicBlock *InvokeDest = II->getUnwindDest();
std::vector<Value*> InvokeDestPHIValues;
@@ -94,10 +93,6 @@ static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock,
// Make sure that anything using the call now uses the invoke!
CI->replaceAllUsesWith(II);
- // Update the callgraph.
- if (CG)
- (*CG)[Caller]->replaceCallSite(CI, II);
-
// Delete the unconditional branch inserted by splitBasicBlock
BB->getInstList().pop_back();
Split->getInstList().pop_front(); // Delete the original call
@@ -438,7 +433,7 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) {
// any inlined 'unwind' instructions into branches to the invoke exception
// destination, and call instructions into invoke instructions.
if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall))
- HandleInlinedInvoke(II, FirstNewBlock, InlinedFunctionInfo, CG);
+ HandleInlinedInvoke(II, FirstNewBlock, InlinedFunctionInfo);
// If we cloned in _exactly one_ basic block, and if that block ends in a
// return instruction, we splice the body of the inlined callee directly into
diff --git a/llvm/test/Transforms/Inline/2009-02-02-InvokeUpdateCG.ll b/llvm/test/Transforms/Inline/2009-02-02-InvokeUpdateCG.ll
deleted file mode 100644
index 38d759656f26..000000000000
--- a/llvm/test/Transforms/Inline/2009-02-02-InvokeUpdateCG.ll
+++ /dev/null
@@ -1,32 +0,0 @@
-; RUN: llvm-as < %s | opt -inline -prune-eh
-; PR3367
-
-define void @f2() {
- invoke void @f6()
- to label %ok1 unwind label %lpad1
-
-ok1:
- ret void
-
-lpad1:
- invoke void @f4()
- to label %ok2 unwind label %lpad2
-
-ok2:
- call void @f8()
- unreachable
-
-lpad2:
- unreachable
-}
-
-declare void @f3()
-
-define void @f4() {
- call void @f3()
- ret void
-}
-
-declare void @f6() nounwind
-
-declare void @f8()