From 6e6026b46569b01f8f6d4dcdb6c899c3a9c76b3e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 20 Nov 2002 18:36:02 +0000 Subject: - Eliminated the deferred symbol table stuff in Module & Function, it really wasn't an optimization and it was causing lots of bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4779 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Linker.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lib/VMCore/Linker.cpp') diff --git a/lib/VMCore/Linker.cpp b/lib/VMCore/Linker.cpp index 8fe9113..0d3cc9b 100644 --- a/lib/VMCore/Linker.cpp +++ b/lib/VMCore/Linker.cpp @@ -32,11 +32,8 @@ static inline bool Error(string *E, string Message) { // Make sure there are no type name conflicts. // static bool LinkTypes(Module *Dest, const Module *Src, string *Err = 0) { - // No symbol table? Can't have named types. - if (!Src->hasSymbolTable()) return false; - - SymbolTable *DestST = Dest->getSymbolTableSure(); - const SymbolTable *SrcST = Src->getSymbolTable(); + SymbolTable *DestST = &Dest->getSymbolTable(); + const SymbolTable *SrcST = &Src->getSymbolTable(); // Look for a type plane for Type's... SymbolTable::const_iterator PI = SrcST->find(Type::TypeTy); @@ -176,7 +173,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src, map &ValueMap, string *Err = 0) { // We will need a module level symbol table if the src module has a module // level symbol table... - SymbolTable *ST = Src->getSymbolTable() ? Dest->getSymbolTableSure() : 0; + SymbolTable *ST = (SymbolTable*)&Src->getSymbolTable(); // Loop over all of the globals in the src module, mapping them over as we go // @@ -266,7 +263,7 @@ static bool LinkFunctionProtos(Module *Dest, const Module *Src, string *Err = 0) { // We will need a module level symbol table if the src module has a module // level symbol table... - SymbolTable *ST = Src->getSymbolTable() ? Dest->getSymbolTableSure() : 0; + SymbolTable *ST = (SymbolTable*)&Src->getSymbolTable(); // Loop over all of the functions in the src module, mapping them over as we // go -- cgit v1.1