Make LTO expect common and weak to be represented differently.
authorDale Johannesen <dalej@apple.com>
Fri, 23 May 2008 00:15:10 +0000 (00:15 +0000)
committerDale Johannesen <dalej@apple.com>
Fri, 23 May 2008 00:15:10 +0000 (00:15 +0000)
Reading .bc files from before that change will no longer work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51457 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lto2/LTOModule.cpp

index 2fd29be272a609aa7619def6109871df78495945..c4bee714c6c8b1faa1d238ae60c214a391bc7498 100644 (file)
@@ -191,17 +191,7 @@ void LTOModule::addDefinedSymbol(GlobalValue* def, Mangler &mangler,
     
     // set definition part 
     if ( def->hasWeakLinkage() || def->hasLinkOnceLinkage() ) {
-        // lvm bitcode does not differenciate between weak def data 
-        // and tentative definitions!
-        // HACK HACK HACK
-        // C++ does not use tentative definitions, but does use weak symbols
-        // so guess that anything that looks like a C++ symbol is weak and others
-        // are tentative definitions
-        if ( (strncmp(symbolName, "__Z", 3) == 0) )
-            attr |= LTO_SYMBOL_DEFINITION_WEAK;
-        else {
-            attr |= LTO_SYMBOL_DEFINITION_TENTATIVE;
-        }
+        attr |= LTO_SYMBOL_DEFINITION_WEAK;
     }
     else if ( def->hasCommonLinkage()) {
         attr |= LTO_SYMBOL_DEFINITION_TENTATIVE;