diff options
author | Chris Lattner <sabre@nondot.org> | 2003-08-23 21:32:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-08-23 21:32:24 +0000 |
commit | 02da0ef418e4c00fd6d4f453576ba5ab5f747af4 (patch) | |
tree | ac3e8a139616cafe41d3a3f92a3903f03dde2ea3 /llvm/lib/Transforms/Utils/Linker.cpp | |
parent | f38c0483bad65e30182e1705b349d85a19282588 (diff) | |
download | bcm5719-llvm-02da0ef418e4c00fd6d4f453576ba5ab5f747af4.tar.gz bcm5719-llvm-02da0ef418e4c00fd6d4f453576ba5ab5f747af4.zip |
Do not consider any types that exist in the global symbol table!
llvm-svn: 8084
Diffstat (limited to 'llvm/lib/Transforms/Utils/Linker.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Linker.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp index 24449ea9f69..2bf095aa55f 100644 --- a/llvm/lib/Transforms/Utils/Linker.cpp +++ b/llvm/lib/Transforms/Utils/Linker.cpp @@ -347,17 +347,18 @@ static GlobalValue *FindGlobalNamed(const std::string &Name, const Type *Ty, // It doesn't exist exactly, scan through all of the type planes in the symbol // table, checking each of them for a type-compatible version. // - for (SymbolTable::iterator I = ST->begin(), E = ST->end(); I != E; ++I) { - SymbolTable::VarMap &VM = I->second; - // Does this type plane contain an entry with the specified name? - SymbolTable::type_iterator TI = VM.find(Name); - if (TI != VM.end()) { - // Determine whether we can fold the two types together, resolving them. - // If so, we can use this value. - if (!RecursiveResolveTypes(Ty, I->first, ST, "")) - return cast<GlobalValue>(TI->second); + for (SymbolTable::iterator I = ST->begin(), E = ST->end(); I != E; ++I) + if (I->first->getType() != Type::TypeTy) { + SymbolTable::VarMap &VM = I->second; + // Does this type plane contain an entry with the specified name? + SymbolTable::type_iterator TI = VM.find(Name); + if (TI != VM.end()) { + // Determine whether we can fold the two types together, resolving them. + // If so, we can use this value. + if (!RecursiveResolveTypes(Ty, I->first, ST, "")) + return cast<GlobalValue>(TI->second); + } } - } return 0; // Otherwise, nothing could be found. } |