File tree 10 files changed +18
-4
lines changed 10 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ class MCAsmInfo {
123
123
// / file. Defaults to "L"
124
124
const char *PrivateGlobalPrefix;
125
125
126
+ // / This prefix is used for labels for basic blocks. Defaults to the same as
127
+ // / PrivateGlobalPrefix.
128
+ const char *PrivateLabelPrefix;
129
+
126
130
// / This prefix is used for symbols that should be passed through the
127
131
// / assembler but be removed by the linker. This is 'l' on Darwin, currently
128
132
// / used for some ObjC metadata. The default of "" meast that for this system
@@ -418,6 +422,7 @@ class MCAsmInfo {
418
422
419
423
bool useAssignmentForEHBegin () const { return UseAssignmentForEHBegin; }
420
424
const char *getPrivateGlobalPrefix () const { return PrivateGlobalPrefix; }
425
+ const char *getPrivateLabelPrefix () const { return PrivateLabelPrefix; }
421
426
bool hasLinkerPrivateGlobalPrefix () const {
422
427
return LinkerPrivateGlobalPrefix[0 ] != ' \0 ' ;
423
428
}
Original file line number Diff line number Diff line change @@ -54,9 +54,7 @@ MCSymbol *MachineBasicBlock::getSymbol() const {
54
54
if (!CachedMCSymbol) {
55
55
const MachineFunction *MF = getParent ();
56
56
MCContext &Ctx = MF->getContext ();
57
- const TargetMachine &TM = MF->getTarget ();
58
- const char *Prefix =
59
- TM.getSubtargetImpl ()->getDataLayout ()->getPrivateGlobalPrefix ();
57
+ const char *Prefix = Ctx.getAsmInfo ()->getPrivateLabelPrefix ();
60
58
CachedMCSymbol = Ctx.GetOrCreateSymbol (Twine (Prefix) + " BB" +
61
59
Twine (MF->getFunctionNumber ()) +
62
60
" _" + Twine (getNumber ()));
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ MCAsmInfo::MCAsmInfo() {
40
40
LabelSuffix = " :" ;
41
41
UseAssignmentForEHBegin = false ;
42
42
PrivateGlobalPrefix = " L" ;
43
+ PrivateLabelPrefix = PrivateGlobalPrefix;
43
44
LinkerPrivateGlobalPrefix = " " ;
44
45
InlineAsmStart = " APP" ;
45
46
InlineAsmEnd = " NO_APP" ;
Original file line number Diff line number Diff line change @@ -30,4 +30,5 @@ MCAsmInfoELF::MCAsmInfoELF() {
30
30
HasIdentDirective = true ;
31
31
WeakRefDirective = " \t .weak\t " ;
32
32
PrivateGlobalPrefix = " .L" ;
33
+ PrivateLabelPrefix = " .L" ;
33
34
}
Original file line number Diff line number Diff line change @@ -4662,7 +4662,7 @@ bool AsmParser::parseMSInlineAsm(
4662
4662
OS << " $$" ;
4663
4663
break ;
4664
4664
case AOK_Label:
4665
- OS << Ctx.getAsmInfo ()->getPrivateGlobalPrefix () << AR.Label ;
4665
+ OS << Ctx.getAsmInfo ()->getPrivateLabelPrefix () << AR.Label ;
4666
4666
break ;
4667
4667
case AOK_Input:
4668
4668
OS << ' $' << InputIdx++;
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ AArch64MCAsmInfoDarwin::AArch64MCAsmInfoDarwin() {
37
37
AssemblerDialect = AsmWriterVariant == Default ? 1 : AsmWriterVariant;
38
38
39
39
PrivateGlobalPrefix = " L" ;
40
+ PrivateLabelPrefix = " L" ;
40
41
SeparatorString = " %%" ;
41
42
CommentString = " ;" ;
42
43
PointerSize = CalleeSaveStackSlotSize = 8 ;
@@ -79,6 +80,7 @@ AArch64MCAsmInfoELF::AArch64MCAsmInfoELF(StringRef TT) {
79
80
80
81
CommentString = " //" ;
81
82
PrivateGlobalPrefix = " .L" ;
83
+ PrivateLabelPrefix = " .L" ;
82
84
Code32Directive = " .code\t 32" ;
83
85
84
86
Data16bitsDirective = " \t .hword\t " ;
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() {
89
89
AlignmentIsInBytes = false ;
90
90
91
91
PrivateGlobalPrefix = " $M" ;
92
+ PrivateLabelPrefix = " $M" ;
92
93
}
93
94
94
95
void ARMCOFFMCAsmInfoGNU::anchor () { }
@@ -101,6 +102,7 @@ ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
101
102
Code16Directive = " .code\t 16" ;
102
103
Code32Directive = " .code\t 32" ;
103
104
PrivateGlobalPrefix = " .L" ;
105
+ PrivateLabelPrefix = " .L" ;
104
106
105
107
SupportsDebugInformation = true ;
106
108
ExceptionsType = ExceptionHandling::None;
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ MipsMCAsmInfo::MipsMCAsmInfo(StringRef TT) {
34
34
Data32bitsDirective = " \t .4byte\t " ;
35
35
Data64bitsDirective = " \t .8byte\t " ;
36
36
PrivateGlobalPrefix = " $" ;
37
+ PrivateLabelPrefix = " $" ;
37
38
CommentString = " #" ;
38
39
ZeroDirective = " \t .space\t " ;
39
40
GPRel32Directive = " \t .gpword\t " ;
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(StringRef &TT) : MCAsmInfoELF() {
17
17
MaxInstLength = 16 ;
18
18
SeparatorString = " \n " ;
19
19
CommentString = " ;" ;
20
+ PrivateGlobalPrefix = " " ;
21
+ PrivateLabelPrefix = " " ;
20
22
InlineAsmStart = " ;#ASMSTART" ;
21
23
InlineAsmEnd = " ;#ASMEND" ;
22
24
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ void X86MCAsmInfoMicrosoft::anchor() { }
134
134
X86MCAsmInfoMicrosoft::X86MCAsmInfoMicrosoft (const Triple &Triple) {
135
135
if (Triple.getArch () == Triple::x86_64) {
136
136
PrivateGlobalPrefix = " .L" ;
137
+ PrivateLabelPrefix = " .L" ;
137
138
PointerSize = 8 ;
138
139
WinEHEncodingType = WinEH::EncodingType::Itanium;
139
140
ExceptionsType = ExceptionHandling::ItaniumWinEH;
@@ -154,6 +155,7 @@ X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(const Triple &Triple) {
154
155
assert (Triple.isOSWindows () && " Windows is the only supported COFF target" );
155
156
if (Triple.getArch () == Triple::x86_64) {
156
157
PrivateGlobalPrefix = " .L" ;
158
+ PrivateLabelPrefix = " .L" ;
157
159
PointerSize = 8 ;
158
160
WinEHEncodingType = WinEH::EncodingType::Itanium;
159
161
ExceptionsType = ExceptionHandling::ItaniumWinEH;
You can’t perform that action at this time.
0 commit comments