diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-13 06:52:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-13 06:52:31 +0000 |
commit | 5a0d4179df79280d37b1cf9fdc8ba8b90c33ee13 (patch) | |
tree | ef06df3cd2d1ae43ad9d1c61d195194227b31390 /lib/Transforms/IPO/InlineSimple.cpp | |
parent | 01bad7fbda047a33e96aee0c5d95f1673d772228 (diff) |
Support indirect calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@764 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/InlineSimple.cpp')
-rw-r--r-- | lib/Transforms/IPO/InlineSimple.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp index c8afc27e3e..609c3f14d9 100644 --- a/lib/Transforms/IPO/InlineSimple.cpp +++ b/lib/Transforms/IPO/InlineSimple.cpp @@ -69,7 +69,8 @@ bool opt::InlineMethod(BasicBlock::iterator CIIt) { CallInst *CI = cast<CallInst>(*CIIt); const Method *CalledMeth = CI->getCalledMethod(); - if (CalledMeth->isExternal()) return false; // Can't inline external method! + if (CalledMeth == 0 || // Can't inline external method or indirect call! + CalledMeth->isExternal()) return false; Method *CurrentMeth = CI->getParent()->getParent(); //cerr << "Inlining " << CalledMeth->getName() << " into " @@ -238,7 +239,7 @@ static inline bool DoMethodInlining(BasicBlock *BB) { if (CallInst *CI = dyn_cast<CallInst>(*I)) { // Check to see if we should inline this method Method *M = CI->getCalledMethod(); - if (ShouldInlineMethod(CI, M)) + if (M && ShouldInlineMethod(CI, M)) return InlineMethod(I); } } |