++I; // Skip over the marker.
}
- // Mangle the first letter specially, don't allow numbers.
- if (*I >= '0' && *I <= '9')
+ // Mangle the first letter specially, don't allow numbers unless the target
+ // explicitly allows them.
+ if (!SymbolsCanStartWithDigit && *I >= '0' && *I <= '9')
Result += MangleLetter(*I++);
for (std::string::const_iterator E = X.end(); I != E; ++I) {
// If the global is anonymous or not led with \1, then add the appropriate
// prefix.
if (!GV->hasName() || GV->getName()[0] != '\1') {
- OutName.append(Prefix, Prefix+strlen(Prefix));
-
if (GV->hasPrivateLinkage() || isImplicitlyPrivate)
OutName.append(PrivatePrefix, PrivatePrefix+strlen(PrivatePrefix));
else if (GV->hasLinkerPrivateLinkage())
OutName.append(LinkerPrivatePrefix,
LinkerPrivatePrefix+strlen(LinkerPrivatePrefix));;
+ OutName.append(Prefix, Prefix+strlen(Prefix));
}
// If the global has a name, just append it now.
const char *linkerPrivatePrefix)
: Prefix(prefix), PrivatePrefix(privatePrefix),
LinkerPrivatePrefix(linkerPrivatePrefix), UseQuotes(false),
- NextAnonGlobalID(1) {
+ SymbolsCanStartWithDigit(false), NextAnonGlobalID(1) {
std::fill(AcceptableChars, array_endof(AcceptableChars), 0);
// Letters and numbers are acceptable.
markCharAcceptable('_');
markCharAcceptable('$');
markCharAcceptable('.');
+ markCharAcceptable('@');
}