llvm.org GIT mirror llvm / 0768632
switch InlineInfo.DevirtualizedCalls's list to be of WeakVH. This fixes a bug where calls inlined into an invoke would get changed into an invoke but the array would keep pointing to the (now dead) call. The improved inliner behavior is still disabled for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102196 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
3 changed file(s) with 7 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2020 #include "llvm/ADT/DenseMap.h"
2121 #include "llvm/ADT/SmallVector.h"
2222 #include "llvm/ADT/Twine.h"
23 #include "llvm/Support/ValueHandle.h"
2324
2425 namespace llvm {
2526
177178 /// DevirtualizedCalls - InlineFunction fills this in with callsites that were
178179 /// inlined from the callee that went from being indirect calls to direct
179180 /// calls due to inlining. This is only filled in if CG is non-null.
180 SmallVector<Instruction*, 2> DevirtualizedCalls;
181 SmallVector<WeakVH, 2> DevirtualizedCalls;
181182
182183 void reset() {
183184 StaticAllocas.clear();
391391 // onto our worklist to process. They are useful inline candidates.
392392 #if 0
393393 for (unsigned i = 0, e = InlineInfo.DevirtualizedCalls.size();
394 i != e; ++i)
395 CallSites.push_back(CallSite(InlineInfo.DevirtualizedCalls[i]));
394 i != e; ++i) {
395 Value *Ptr = InlineInfo.DevirtualizedCalls[i];
396 CallSites.push_back(CallSite(Ptr));
397 }
396398 #endif
397399
398400 // Update the cached cost info with the inlined call.
7171 II->setAttributes(CI->getAttributes());
7272
7373 // Make sure that anything using the call now uses the invoke! This also
74 // updates the CallGraph if present.
74 // updates the CallGraph if present, because it uses a WeakVH.
7575 CI->replaceAllUsesWith(II);
7676
7777 // Delete the unconditional branch inserted by splitBasicBlock