[llvm-commits] [llvm] r48180 - /llvm/trunk/lib/Linker/LinkModules.cpp

Anton Korobeynikov asl at math.spbu.ru
Mon Mar 10 15:34:46 PDT 2008


Author: asl
Date: Mon Mar 10 17:34:46 2008
New Revision: 48180

URL: http://llvm.org/viewvc/llvm-project?rev=48180&view=rev
Log:
Make error messages to have common style

Modified:
    llvm/trunk/lib/Linker/LinkModules.cpp

Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=48180&r1=48179&r2=48180&view=diff

==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Mar 10 17:34:46 2008
@@ -544,9 +544,8 @@
         // Make sure to remember this mapping...
         ValueMap.insert(std::make_pair(SGV, DGA));
       } else
-        return Error(Err, "Global-Alias Collision on '" +
-                     ToStr(SGV->getType(), Src) +"':%"+SGV->getName()+
-                     " - symbol multiple defined");
+        return Error(Err, "Global-Alias Collision on '" + SGV->getName() +
+                     "': symbol multiple defined");
     } else if (GlobalVariable *DGVar = dyn_cast<GlobalVariable>(DGV)) {
       // Otherwise, perform the mapping as instructed by GetLinkageResult.
       if (LinkFromSrc) {
@@ -638,9 +637,8 @@
       // If types don't agree due to opaque types, try to resolve them.
       if (RecursiveResolveTypes(SGA->getType(), DGA->getType(),
                                 &Dest->getTypeSymbolTable(), ""))
-        return Error(Err, "Alias Collision on '" +
-                         ToStr(SGA->getType(), Src) +"':%"+SGA->getName()+
-                     " - aliases have different types");
+        return Error(Err, "Alias Collision on '" + SGA->getName()+
+                     "': aliases have different types");
 
       // Now types are known to be the same, check whether aliasees equal. As
       // globals are already linked we just need query ValueMap to find the
@@ -653,9 +651,8 @@
         NewGA = DGA;
         // Proceed to 'common' steps
       } else
-        return Error(Err, "Alias Collision on '" +
-                     ToStr(SGA->getType(), Src) +"':%"+SGA->getName()+
-                     " - aliases have different aliasees");
+        return Error(Err, "Alias Collision on '"  + SGA->getName()+
+                     "': aliases have different aliasees");
     } else if (GlobalVariable *DGV = Dest->getGlobalVariable(SGA->getName())) {
       RecursiveResolveTypes(SGA->getType(), DGV->getType(),
                             &Dest->getTypeSymbolTable(), "");
@@ -680,9 +677,8 @@
 
         // Proceed to 'common' steps
       } else
-        return Error(Err, "Global-Alias Collision on '" +
-                     ToStr(SGA->getType(), Src) +"':%"+SGA->getName()+
-                     " - symbol multiple defined");
+        return Error(Err, "Global-Alias Collision on '" + SGA->getName() +
+                     "': symbol multiple defined");
     } else if (Function *DF = Dest->getFunction(SGA->getName())) {
       RecursiveResolveTypes(SGA->getType(), DF->getType(),
                             &Dest->getTypeSymbolTable(), "");
@@ -707,9 +703,8 @@
 
         // Proceed to 'common' steps
       } else
-        return Error(Err, "Function-Alias Collision on '" +
-                     ToStr(SGA->getType(), Src) +"':%"+SGA->getName()+
-                     " - symbol multiple defined");
+        return Error(Err, "Function-Alias Collision on '" + SGA->getName() +
+                     "': symbol multiple defined");
     } else {
       // Nothing similar found, just copy alias into destination module.
 
@@ -758,9 +753,8 @@
       if (DGV->hasInitializer()) {
         if (SGV->hasExternalLinkage()) {
           if (DGV->getInitializer() != SInit)
-            return Error(Err, "Global Variable Collision on '" +
-                         ToStr(SGV->getType(), Src) +"':%"+SGV->getName()+
-                         " - Global variables have different initializers");
+            return Error(Err, "Global Variable Collision on '" + SGV->getName() +
+                         "': global variables have different initializers");
         } else if (DGV->hasLinkOnceLinkage() || DGV->hasWeakLinkage()) {
           // Nothing is required, mapped values will take the new global
           // automatically.





More information about the llvm-commits mailing list