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 | cfc2f446a67133b67d42941f3fb88d66ee62e928 (patch) | |
tree | 52c563249b8f58629bc24e03ac340b3f27b96365 /llvm/lib/Transforms/IPO/InlineSimple.cpp | |
parent | 9be166000d6636994ddd382e56faa071d85053cc (diff) | |
download | bcm5719-llvm-cfc2f446a67133b67d42941f3fb88d66ee62e928.tar.gz bcm5719-llvm-cfc2f446a67133b67d42941f3fb88d66ee62e928.zip |
Support indirect calls
llvm-svn: 764
Diffstat (limited to 'llvm/lib/Transforms/IPO/InlineSimple.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/InlineSimple.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp index c8afc27e3ec..609c3f14d98 100644 --- a/llvm/lib/Transforms/IPO/InlineSimple.cpp +++ b/llvm/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); } } |