diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-12-04 00:06:57 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-12-04 00:06:57 +0000 |
| commit | 4e27343eec284d9028617171a82a5816420fe4c7 (patch) | |
| tree | e1f2a4622f68ba63debb758e0c30e372caecc196 /llvm/lib/MC | |
| parent | a7eb3cb46e83a6c275cd212c95497627e157aa98 (diff) | |
| download | bcm5719-llvm-4e27343eec284d9028617171a82a5816420fe4c7.tar.gz bcm5719-llvm-4e27343eec284d9028617171a82a5816420fe4c7.zip | |
Allow target to specify prefix for labels
Use the MCAsmInfo instead of the DataLayout, and allow
specifying a custom prefix for labels specifically. HSAIL
requires that labels begin with @, but global symbols with &.
llvm-svn: 223323
Diffstat (limited to 'llvm/lib/MC')
| -rw-r--r-- | llvm/lib/MC/MCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/MC/MCAsmInfoELF.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCAsmInfo.cpp b/llvm/lib/MC/MCAsmInfo.cpp index 053061823ff..6fe2804e30a 100644 --- a/llvm/lib/MC/MCAsmInfo.cpp +++ b/llvm/lib/MC/MCAsmInfo.cpp @@ -40,6 +40,7 @@ MCAsmInfo::MCAsmInfo() { LabelSuffix = ":"; UseAssignmentForEHBegin = false; PrivateGlobalPrefix = "L"; + PrivateLabelPrefix = PrivateGlobalPrefix; LinkerPrivateGlobalPrefix = ""; InlineAsmStart = "APP"; InlineAsmEnd = "NO_APP"; diff --git a/llvm/lib/MC/MCAsmInfoELF.cpp b/llvm/lib/MC/MCAsmInfoELF.cpp index 9f70d8da80a..2fe626e6e0d 100644 --- a/llvm/lib/MC/MCAsmInfoELF.cpp +++ b/llvm/lib/MC/MCAsmInfoELF.cpp @@ -30,4 +30,5 @@ MCAsmInfoELF::MCAsmInfoELF() { HasIdentDirective = true; WeakRefDirective = "\t.weak\t"; PrivateGlobalPrefix = ".L"; + PrivateLabelPrefix = ".L"; } diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index de7d96129f1..68889cb2053 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -4662,7 +4662,7 @@ bool AsmParser::parseMSInlineAsm( OS << "$$"; break; case AOK_Label: - OS << Ctx.getAsmInfo()->getPrivateGlobalPrefix() << AR.Label; + OS << Ctx.getAsmInfo()->getPrivateLabelPrefix() << AR.Label; break; case AOK_Input: OS << '$' << InputIdx++; |

