Support external methods
authorChris Lattner <sabre@nondot.org>
Sun, 15 Jul 2001 21:43:45 +0000 (21:43 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 15 Jul 2001 21:43:45 +0000 (21:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/InlineSimple.cpp
lib/Transforms/Scalar/SCCP.cpp

index b7cefacaf32ba82f4a65aba9de2171d624b0d452..bd4fd26a9dd975d3c332f7918c79413f1dccd4f7 100644 (file)
@@ -70,6 +70,7 @@ bool opt::InlineMethod(BasicBlock::iterator CIIt) {
 
   CallInst *CI = (CallInst*)*CIIt;
   const Method *CalledMeth = CI->getCalledMethod();
+  if (CalledMeth->isExternal()) return false;  // Can't inline external method!
   Method *CurrentMeth = CI->getParent()->getParent();
 
   //cerr << "Inlining " << CalledMeth->getName() << " into " 
index 63ce5125087817c2eb72919da33b8206742aff2b..a28155260ee656c5076fa2812f2f6efcae6db29e 100644 (file)
@@ -515,6 +515,7 @@ void SCCP::OperandChangedState(User *U) {
 // to prove whether a value is constant and whether blocks are used.
 //
 bool opt::DoSCCP(Method *M) {
+  if (M->isExternal()) return false;
   SCCP S(M);
   return S.doSCCP();
 }