aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Transforms/Utils/Cloning.h3
-rw-r--r--lib/Transforms/IPO/Inliner.cpp6
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp2
3 files changed, 7 insertions, 4 deletions
diff --git a/include/llvm/Transforms/Utils/Cloning.h b/include/llvm/Transforms/Utils/Cloning.h
index a9dc95b4a8..463c5d48e9 100644
--- a/include/llvm/Transforms/Utils/Cloning.h
+++ b/include/llvm/Transforms/Utils/Cloning.h
@@ -21,6 +21,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
+#include "llvm/Support/ValueHandle.h"
namespace llvm {
@@ -178,7 +179,7 @@ public:
/// DevirtualizedCalls - InlineFunction fills this in with callsites that were
/// inlined from the callee that went from being indirect calls to direct
/// calls due to inlining. This is only filled in if CG is non-null.
- SmallVector<Instruction*, 2> DevirtualizedCalls;
+ SmallVector<WeakVH, 2> DevirtualizedCalls;
void reset() {
StaticAllocas.clear();
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index 322b469875..1ac609ddf2 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -392,8 +392,10 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) {
// onto our worklist to process. They are useful inline candidates.
#if 0
for (unsigned i = 0, e = InlineInfo.DevirtualizedCalls.size();
- i != e; ++i)
- CallSites.push_back(CallSite(InlineInfo.DevirtualizedCalls[i]));
+ i != e; ++i) {
+ Value *Ptr = InlineInfo.DevirtualizedCalls[i];
+ CallSites.push_back(CallSite(Ptr));
+ }
#endif
// Update the cached cost info with the inlined call.
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp
index a913d157e2..481cacf5a1 100644
--- a/lib/Transforms/Utils/InlineFunction.cpp
+++ b/lib/Transforms/Utils/InlineFunction.cpp
@@ -72,7 +72,7 @@ static void HandleCallsInBlockInlinedThroughInvoke(BasicBlock *BB,
II->setAttributes(CI->getAttributes());
// Make sure that anything using the call now uses the invoke! This also
- // updates the CallGraph if present.
+ // updates the CallGraph if present, because it uses a WeakVH.
CI->replaceAllUsesWith(II);
// Delete the unconditional branch inserted by splitBasicBlock