diff options
| author | Duncan Sands <baldrick@free.fr> | 2008-09-06 17:19:29 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2008-09-06 17:19:29 +0000 |
| commit | 7e8958a9f3366d225ddff95a069efb61f9f3567a (patch) | |
| tree | 3168dc0eb88a1e642f32e7dc1dc026434b7b7072 /lib/Transforms/IPO | |
| parent | 64284aad97fce41a1299c01b0b2a544b8dd425cd (diff) | |
| download | external_llvm-7e8958a9f3366d225ddff95a069efb61f9f3567a.zip external_llvm-7e8958a9f3366d225ddff95a069efb61f9f3567a.tar.gz external_llvm-7e8958a9f3366d225ddff95a069efb61f9f3567a.tar.bz2 | |
When PruneEH turned an invoke into an ordinary
call (thus changing the call site) it didn't
inform the callgraph about this. But the
call site does matter - as shown by the testcase,
the callgraph become invalid after the inliner
ran (with an edge between two functions simply
missing), resulting in wrong deductions by
GlobalsModRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
| -rw-r--r-- | lib/Transforms/IPO/PruneEH.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp index 8fb904b..630768f 100644 --- a/lib/Transforms/IPO/PruneEH.cpp +++ b/lib/Transforms/IPO/PruneEH.cpp @@ -156,6 +156,9 @@ bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) { // function if we have invokes to non-unwinding functions or code after calls to // no-return functions. bool PruneEH::SimplifyFunction(Function *F) { + CallGraph &CG = getAnalysis<CallGraph>(); + CallGraphNode *CGN = CG[F]; + bool MadeChange = false; for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) { if (InvokeInst *II = dyn_cast<InvokeInst>(BB->getTerminator())) @@ -174,6 +177,9 @@ bool PruneEH::SimplifyFunction(Function *F) { BasicBlock *UnwindBlock = II->getUnwindDest(); UnwindBlock->removePredecessor(II->getParent()); + // Fix up the call graph. + CGN->replaceCallSite(II, Call); + // Insert a branch to the normal destination right before the // invoke. BranchInst::Create(II->getNormalDest(), II); |
