diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-11-28 17:00:49 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-11-28 17:00:49 +0000 |
commit | 848493d886c46f00cea951ec8b76615b63f86f61 (patch) | |
tree | 68d03eb75750e63d586c30cc69224f1e00e8953e /llvm/lib | |
parent | 9c19956845808a7a0972e58b08864da36c1ddaf0 (diff) | |
download | bcm5719-llvm-848493d886c46f00cea951ec8b76615b63f86f61.tar.gz bcm5719-llvm-848493d886c46f00cea951ec8b76615b63f86f61.zip |
The global prefix is always one char. Don't use a string for it.
llvm-svn: 195926
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/MC/MCAsmInfo.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/MC/MCAsmInfoCOFF.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/MC/MCAsmInfoDarwin.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/Mangler.cpp | 11 | ||||
-rw-r--r-- | llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp | 4 |
5 files changed, 8 insertions, 13 deletions
diff --git a/llvm/lib/MC/MCAsmInfo.cpp b/llvm/lib/MC/MCAsmInfo.cpp index 28f1c951641..a2ff92ff4f9 100644 --- a/llvm/lib/MC/MCAsmInfo.cpp +++ b/llvm/lib/MC/MCAsmInfo.cpp @@ -41,7 +41,7 @@ MCAsmInfo::MCAsmInfo() { CommentString = "#"; LabelSuffix = ":"; DebugLabelSuffix = ":"; - GlobalPrefix = ""; + GlobalPrefix = '\0'; PrivateGlobalPrefix = "."; LinkerPrivateGlobalPrefix = ""; InlineAsmStart = "APP"; diff --git a/llvm/lib/MC/MCAsmInfoCOFF.cpp b/llvm/lib/MC/MCAsmInfoCOFF.cpp index 9d9f98e72b9..54ae3a272db 100644 --- a/llvm/lib/MC/MCAsmInfoCOFF.cpp +++ b/llvm/lib/MC/MCAsmInfoCOFF.cpp @@ -18,7 +18,7 @@ using namespace llvm; void MCAsmInfoCOFF::anchor() { } MCAsmInfoCOFF::MCAsmInfoCOFF() { - GlobalPrefix = "_"; + GlobalPrefix = '_'; // MingW 4.5 and later support .comm with log2 alignment, but .lcomm uses byte // alignment. COMMDirectiveAlignmentIsInBytes = false; diff --git a/llvm/lib/MC/MCAsmInfoDarwin.cpp b/llvm/lib/MC/MCAsmInfoDarwin.cpp index 704c8161f88..8a021ce3ae7 100644 --- a/llvm/lib/MC/MCAsmInfoDarwin.cpp +++ b/llvm/lib/MC/MCAsmInfoDarwin.cpp @@ -23,7 +23,7 @@ void MCAsmInfoDarwin::anchor() { } MCAsmInfoDarwin::MCAsmInfoDarwin() { // Common settings for all Darwin targets. // Syntax: - GlobalPrefix = "_"; + GlobalPrefix = '_'; PrivateGlobalPrefix = "L"; LinkerPrivateGlobalPrefix = "l"; HasSingleParameterDotFile = false; diff --git a/llvm/lib/Target/Mangler.cpp b/llvm/lib/Target/Mangler.cpp index 5430d509452..c41a0f3591b 100644 --- a/llvm/lib/Target/Mangler.cpp +++ b/llvm/lib/Target/Mangler.cpp @@ -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. diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp index 3861e1ce290..45f22a1366e 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp @@ -128,7 +128,7 @@ void X86MCAsmInfoMicrosoft::anchor() { } X86MCAsmInfoMicrosoft::X86MCAsmInfoMicrosoft(const Triple &Triple) { if (Triple.getArch() == Triple::x86_64) { - GlobalPrefix = ""; + GlobalPrefix = '\0'; PrivateGlobalPrefix = ".L"; } @@ -143,7 +143,7 @@ void X86MCAsmInfoGNUCOFF::anchor() { } X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(const Triple &Triple) { if (Triple.getArch() == Triple::x86_64) { - GlobalPrefix = ""; + GlobalPrefix = '\0'; PrivateGlobalPrefix = ".L"; } |