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 | f44c6051e02ddb207d5928b4ef3cde956d2b5025 (patch) | |
tree | 03eb544293adf0b198e3dd48a7a8778ee799c867 /lib | |
parent | e3092c94ad2e3af96f37a0a8186149acbbd9700a (diff) | |
download | external_llvm-f44c6051e02ddb207d5928b4ef3cde956d2b5025.zip external_llvm-f44c6051e02ddb207d5928b4ef3cde956d2b5025.tar.gz external_llvm-f44c6051e02ddb207d5928b4ef3cde956d2b5025.tar.bz2 |
Do not consider any types that exist in the global symbol table!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Linker/LinkModules.cpp | 21 | ||||
-rw-r--r-- | lib/Transforms/Utils/Linker.cpp | 21 | ||||
-rw-r--r-- | lib/VMCore/Linker.cpp | 21 |
3 files changed, 33 insertions, 30 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 24449ea..2bf095a 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.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. } diff --git a/lib/Transforms/Utils/Linker.cpp b/lib/Transforms/Utils/Linker.cpp index 24449ea..2bf095a 100644 --- a/lib/Transforms/Utils/Linker.cpp +++ b/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. } diff --git a/lib/VMCore/Linker.cpp b/lib/VMCore/Linker.cpp index 24449ea..2bf095a 100644 --- a/lib/VMCore/Linker.cpp +++ b/lib/VMCore/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. } |