The global prefix is always one char. Don't use a string for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195926 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2013-11-28 17:00:49 +00:00
parent 98bb341955
commit 4ca0ef70cd
6 changed files with 12 additions and 17 deletions

View 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.