Support external methods
llvm-svn: 200
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp
index b7cefac..bd4fd26 100644
--- a/llvm/lib/Transforms/IPO/InlineSimple.cpp
+++ b/llvm/lib/Transforms/IPO/InlineSimple.cpp
@@ -70,6 +70,7 @@
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 "
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index 63ce512..a281552 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -515,6 +515,7 @@
// 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();
}