mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
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:
parent
98bb341955
commit
4ca0ef70cd
@ -115,9 +115,9 @@ namespace llvm {
|
|||||||
/// LabelSuffix - This is appended to emitted labels.
|
/// LabelSuffix - This is appended to emitted labels.
|
||||||
const char *DebugLabelSuffix; // Defaults to ":"
|
const char *DebugLabelSuffix; // Defaults to ":"
|
||||||
|
|
||||||
/// GlobalPrefix - If this is set to a non-empty string, it is prepended
|
/// If this is set to anything other than '\0', it is prepended
|
||||||
/// onto all global symbols. This is often used for "_" or ".".
|
/// onto all global symbols. This is often used for '_'.
|
||||||
const char *GlobalPrefix; // Defaults to ""
|
char GlobalPrefix; // Defaults to '\0'
|
||||||
|
|
||||||
/// PrivateGlobalPrefix - This prefix is used for globals like constant
|
/// PrivateGlobalPrefix - This prefix is used for globals like constant
|
||||||
/// pool entries that are completely private to the .s file and should not
|
/// pool entries that are completely private to the .s file and should not
|
||||||
@ -428,7 +428,7 @@ namespace llvm {
|
|||||||
return DebugLabelSuffix;
|
return DebugLabelSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *getGlobalPrefix() const {
|
char getGlobalPrefix() const {
|
||||||
return GlobalPrefix;
|
return GlobalPrefix;
|
||||||
}
|
}
|
||||||
const char *getPrivateGlobalPrefix() const {
|
const char *getPrivateGlobalPrefix() const {
|
||||||
|
@ -41,7 +41,7 @@ MCAsmInfo::MCAsmInfo() {
|
|||||||
CommentString = "#";
|
CommentString = "#";
|
||||||
LabelSuffix = ":";
|
LabelSuffix = ":";
|
||||||
DebugLabelSuffix = ":";
|
DebugLabelSuffix = ":";
|
||||||
GlobalPrefix = "";
|
GlobalPrefix = '\0';
|
||||||
PrivateGlobalPrefix = ".";
|
PrivateGlobalPrefix = ".";
|
||||||
LinkerPrivateGlobalPrefix = "";
|
LinkerPrivateGlobalPrefix = "";
|
||||||
InlineAsmStart = "APP";
|
InlineAsmStart = "APP";
|
||||||
|
@ -18,7 +18,7 @@ using namespace llvm;
|
|||||||
void MCAsmInfoCOFF::anchor() { }
|
void MCAsmInfoCOFF::anchor() { }
|
||||||
|
|
||||||
MCAsmInfoCOFF::MCAsmInfoCOFF() {
|
MCAsmInfoCOFF::MCAsmInfoCOFF() {
|
||||||
GlobalPrefix = "_";
|
GlobalPrefix = '_';
|
||||||
// MingW 4.5 and later support .comm with log2 alignment, but .lcomm uses byte
|
// MingW 4.5 and later support .comm with log2 alignment, but .lcomm uses byte
|
||||||
// alignment.
|
// alignment.
|
||||||
COMMDirectiveAlignmentIsInBytes = false;
|
COMMDirectiveAlignmentIsInBytes = false;
|
||||||
|
@ -23,7 +23,7 @@ void MCAsmInfoDarwin::anchor() { }
|
|||||||
MCAsmInfoDarwin::MCAsmInfoDarwin() {
|
MCAsmInfoDarwin::MCAsmInfoDarwin() {
|
||||||
// Common settings for all Darwin targets.
|
// Common settings for all Darwin targets.
|
||||||
// Syntax:
|
// Syntax:
|
||||||
GlobalPrefix = "_";
|
GlobalPrefix = '_';
|
||||||
PrivateGlobalPrefix = "L";
|
PrivateGlobalPrefix = "L";
|
||||||
LinkerPrivateGlobalPrefix = "l";
|
LinkerPrivateGlobalPrefix = "l";
|
||||||
HasSingleParameterDotFile = false;
|
HasSingleParameterDotFile = false;
|
||||||
|
@ -47,14 +47,9 @@ void Mangler::getNameWithPrefix(SmallVectorImpl<char> &OutName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char *Prefix = MAI->getGlobalPrefix();
|
char Prefix = MAI->getGlobalPrefix();
|
||||||
if (Prefix[0] == 0)
|
if (Prefix != '\0')
|
||||||
; // Common noop, no prefix.
|
OutName.push_back(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));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is a simple string that doesn't need escaping, just append it.
|
// If this is a simple string that doesn't need escaping, just append it.
|
||||||
|
@ -128,7 +128,7 @@ void X86MCAsmInfoMicrosoft::anchor() { }
|
|||||||
|
|
||||||
X86MCAsmInfoMicrosoft::X86MCAsmInfoMicrosoft(const Triple &Triple) {
|
X86MCAsmInfoMicrosoft::X86MCAsmInfoMicrosoft(const Triple &Triple) {
|
||||||
if (Triple.getArch() == Triple::x86_64) {
|
if (Triple.getArch() == Triple::x86_64) {
|
||||||
GlobalPrefix = "";
|
GlobalPrefix = '\0';
|
||||||
PrivateGlobalPrefix = ".L";
|
PrivateGlobalPrefix = ".L";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ void X86MCAsmInfoGNUCOFF::anchor() { }
|
|||||||
|
|
||||||
X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(const Triple &Triple) {
|
X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(const Triple &Triple) {
|
||||||
if (Triple.getArch() == Triple::x86_64) {
|
if (Triple.getArch() == Triple::x86_64) {
|
||||||
GlobalPrefix = "";
|
GlobalPrefix = '\0';
|
||||||
PrivateGlobalPrefix = ".L";
|
PrivateGlobalPrefix = ".L";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user