summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-19 23:32:50 +0000
committerChris Lattner <sabre@nondot.org>2003-10-19 23:32:50 +0000
commit9fc2adc48781da63b2554d40960d0e63de238add (patch)
tree997e7c8d63173597928fca7682e05455580b5d4a /tools
parent6ebe44d22f6dd1ab9f7aa1f3cfd02be52145d535 (diff)
downloadllvm-9fc2adc48781da63b2554d40960d0e63de238add.tar.gz
llvm-9fc2adc48781da63b2554d40960d0e63de238add.tar.bz2
llvm-9fc2adc48781da63b2554d40960d0e63de238add.tar.xz
Don't bother forwarding function references which are external to the program entirely
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9274 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/bugpoint/CodeGeneratorBug.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/bugpoint/CodeGeneratorBug.cpp b/tools/bugpoint/CodeGeneratorBug.cpp
index 0aea9b031d..21cfa08069 100644
--- a/tools/bugpoint/CodeGeneratorBug.cpp
+++ b/tools/bugpoint/CodeGeneratorBug.cpp
@@ -112,8 +112,10 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
// Use the function we just added to get addresses of functions we need
// Iterate over the global declarations in the Safe module
for (Module::iterator F=SafeModule->begin(),E=SafeModule->end(); F!=E; ++F){
- if (F->isExternal() && !F->use_empty() && &(*F) != resolverFunc &&
- F->getIntrinsicID() == 0 /* ignore intrinsics */) {
+ if (F->isExternal() && !F->use_empty() && &*F != resolverFunc &&
+ F->getIntrinsicID() == 0 /* ignore intrinsics */ &&
+ // Don't forward functions which are external in the test module too.
+ !TestModule->getNamedFunction(F->getName())->isExternal()) {
// If it has a non-zero use list,
// 1. Add a string constant with its name to the global file
// The correct type is `const [ NUM x sbyte ]' where NUM is length of