From e08024130b7e7968e1da3ae029f1b0046544b4cd Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 12 Dec 2006 23:15:28 +0000 Subject: [PATCH] Do not runOnFunction on external functions. llvm-svn: 32510 --- lib/VMCore/PassManager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index 06f7af86bba..f8bfe59dd94 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -761,6 +761,9 @@ BasicBlockPassManager_New::addPass(Pass *P) { bool BasicBlockPassManager_New::runOnFunction(Function &F) { + if (F.isExternal()) + return false; + bool Changed = doInitialization(F); initializeAnalysisInfo(); @@ -972,6 +975,10 @@ bool FunctionPassManagerImpl_New::runOnModule(Module &M) { bool FunctionPassManagerImpl_New::runOnFunction(Function &F) { bool Changed = false; + + if (F.isExternal()) + return false; + initializeAnalysisInfo(); for (std::vector::iterator itr = passVectorBegin(),