The global prefix is always one char. Don't use a string for it.
[oota-llvm.git] / lib / Target / Mangler.cpp
index 5430d50945256f2a9efb21ca2a931533612592ee..c41a0f3591bd9eef365f1a854fb444f2f697522f 100644 (file)
@@ -47,14 +47,9 @@ void Mangler::getNameWithPrefix(SmallVectorImpl<char> &OutName,
     }
 
 
-    const char *Prefix = MAI->getGlobalPrefix();
-    if (Prefix[0] == 0)
-      ; // Common noop, no prefix.
-    else if (Prefix[1] == 0)
-      OutName.push_back(Prefix[0]);  // Common, one character prefix.
-    else
-      // Arbitrary length prefix.
-      OutName.append(Prefix, Prefix+strlen(Prefix));
+    char Prefix = MAI->getGlobalPrefix();
+    if (Prefix != '\0')
+      OutName.push_back(Prefix);
   }
 
   // If this is a simple string that doesn't need escaping, just append it.