mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
eliminate the Mangler::PreserveAsmNames bit, the sole client of this
can do it perfectly well itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75743 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -38,10 +38,6 @@ class Mangler {
|
|||||||
/// the space character. By default, this is false.
|
/// the space character. By default, this is false.
|
||||||
bool UseQuotes;
|
bool UseQuotes;
|
||||||
|
|
||||||
/// PreserveAsmNames - If this is set, the asm escape character is not removed
|
|
||||||
/// from names with 'asm' specifiers.
|
|
||||||
bool PreserveAsmNames;
|
|
||||||
|
|
||||||
/// AnonGlobalIDs - We need to give global values the same name every time
|
/// AnonGlobalIDs - We need to give global values the same name every time
|
||||||
/// they are mangled. This keeps track of the number we give to anonymous
|
/// they are mangled. This keeps track of the number we give to anonymous
|
||||||
/// ones.
|
/// ones.
|
||||||
@@ -65,10 +61,6 @@ public:
|
|||||||
/// strings for assembler labels.
|
/// strings for assembler labels.
|
||||||
void setUseQuotes(bool Val) { UseQuotes = Val; }
|
void setUseQuotes(bool Val) { UseQuotes = Val; }
|
||||||
|
|
||||||
/// setPreserveAsmNames - If the mangler should not strip off the asm name
|
|
||||||
/// @verbatim identifier (\001), this should be set. @endverbatim
|
|
||||||
void setPreserveAsmNames(bool Val) { PreserveAsmNames = Val; }
|
|
||||||
|
|
||||||
/// Acceptable Characters - This allows the target to specify which characters
|
/// Acceptable Characters - This allows the target to specify which characters
|
||||||
/// are acceptable to the assembler without being mangled. By default we
|
/// are acceptable to the assembler without being mangled. By default we
|
||||||
/// allow letters, numbers, '_', '$', and '.', which is what GAS accepts.
|
/// allow letters, numbers, '_', '$', and '.', which is what GAS accepts.
|
||||||
|
@@ -35,10 +35,6 @@ std::string Mangler::makeNameProper(const std::string &X,
|
|||||||
bool hasPrivateLinkage) {
|
bool hasPrivateLinkage) {
|
||||||
assert(!X.empty() && "Cannot mangle empty strings");
|
assert(!X.empty() && "Cannot mangle empty strings");
|
||||||
|
|
||||||
// If PreserveAsmNames is set, names with asm identifiers are not modified.
|
|
||||||
if (PreserveAsmNames && X[0] == 1)
|
|
||||||
return X;
|
|
||||||
|
|
||||||
if (!UseQuotes) {
|
if (!UseQuotes) {
|
||||||
std::string Result;
|
std::string Result;
|
||||||
|
|
||||||
@@ -149,7 +145,7 @@ std::string Mangler::getMangledName(const GlobalValue *GV, const char *Suffix,
|
|||||||
|
|
||||||
Mangler::Mangler(Module &M, const char *prefix, const char *privatePrefix)
|
Mangler::Mangler(Module &M, const char *prefix, const char *privatePrefix)
|
||||||
: Prefix(prefix), PrivatePrefix (privatePrefix), UseQuotes(false),
|
: Prefix(prefix), PrivatePrefix (privatePrefix), UseQuotes(false),
|
||||||
PreserveAsmNames(false), NextAnonGlobalID(1) {
|
NextAnonGlobalID(1) {
|
||||||
std::fill(AcceptableChars, array_endof(AcceptableChars), 0);
|
std::fill(AcceptableChars, array_endof(AcceptableChars), 0);
|
||||||
|
|
||||||
// Letters and numbers are acceptable.
|
// Letters and numbers are acceptable.
|
||||||
|
@@ -241,12 +241,17 @@ static void DisambiguateGlobalSymbols(Module *M) {
|
|||||||
Mangler Mang(*M);
|
Mangler Mang(*M);
|
||||||
// Agree with the CBE on symbol naming
|
// Agree with the CBE on symbol naming
|
||||||
Mang.markCharUnacceptable('.');
|
Mang.markCharUnacceptable('.');
|
||||||
Mang.setPreserveAsmNames(true);
|
|
||||||
for (Module::global_iterator I = M->global_begin(), E = M->global_end();
|
for (Module::global_iterator I = M->global_begin(), E = M->global_end();
|
||||||
I != E; ++I)
|
I != E; ++I) {
|
||||||
I->setName(Mang.getMangledName(I));
|
// Don't mangle asm names.
|
||||||
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
|
if (!I->hasName() || I->getName()[0] != 1)
|
||||||
I->setName(Mang.getMangledName(I));
|
I->setName(Mang.getMangledName(I));
|
||||||
|
}
|
||||||
|
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
|
||||||
|
// Don't mangle asm names.
|
||||||
|
if (!I->hasName() || I->getName()[0] != 1)
|
||||||
|
I->setName(Mang.getMangledName(I));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ExtractLoops - Given a reduced list of functions that still exposed the bug,
|
/// ExtractLoops - Given a reduced list of functions that still exposed the bug,
|
||||||
|
Reference in New Issue
Block a user