In getID(), don't call getValidSymbolName to mangle external names!
authorVikram S. Adve <vadve@cs.uiuc.edu>
Wed, 30 Oct 2002 20:16:38 +0000 (20:16 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Wed, 30 Oct 2002 20:16:38 +0000 (20:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4451 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9AsmPrinter.cpp

index 73f87f83d4b3e6e8824c5b25fdb479c3abc8a79f..0357c597039cfc31196f6dee2947a9fbcd1a743a 100644 (file)
@@ -139,9 +139,9 @@ public:
   //
   string getID(const Value *V, const char *Prefix, const char *FPrefix = 0) {
     string Result = FPrefix ? FPrefix : "";  // "Forced prefix"
-    
+
     Result +=  V->hasName() ? V->getName() : string(Prefix);
-    
+
     // Qualify all internal names with a unique id.
     if (!isExternal(V)) {
       int valId = idTable->Table.getValSlot(V);
@@ -153,9 +153,12 @@ public:
           valId = I->second;
       }
       Result = Result + "_" + itostr(valId);
+
+      // Replace or prefix problem characters in the name
+      Result = getValidSymbolName(Result);
     }
-    
-    return getValidSymbolName(Result);
+
+    return Result;
   }
   
   // getID Wrappers - Ensure consistent usage...