Skip to content

Commit 4aa23cc

Browse files
committed
MCAsmInfo: Explicitly set AllowDollarAtStartOfIdentifier to false for some targets
The default AllowDollarAtStartOfIdentifier will be changed to true to align better with GNU Assembler where $ is a valid initial identifier char.
1 parent f786916 commit 4aa23cc

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(const Triple &TheTriple) {
5353

5454
Data64bitsDirective = nullptr;
5555
CommentString = "@";
56+
AllowDollarAtStartOfIdentifier = false;
5657
UseDataRegionDirectives = true;
5758

5859
SupportsDebugInformation = true;
@@ -80,6 +81,7 @@ ARMELFMCAsmInfo::ARMELFMCAsmInfo(const Triple &TheTriple) {
8081

8182
Data64bitsDirective = nullptr;
8283
CommentString = "@";
84+
AllowDollarAtStartOfIdentifier = false;
8385

8486
SupportsDebugInformation = true;
8587

@@ -137,6 +139,7 @@ ARMCOFFMCAsmInfoGNU::ARMCOFFMCAsmInfoGNU() {
137139
HasSingleParameterDotFile = true;
138140

139141
CommentString = "@";
142+
AllowDollarAtStartOfIdentifier = false;
140143
PrivateGlobalPrefix = ".L";
141144
PrivateLabelPrefix = ".L";
142145

llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCAsmInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ LoongArchMCAsmInfo::LoongArchMCAsmInfo(const Triple &TT) {
205205
Data64bitsDirective = "\t.dword\t";
206206
ZeroDirective = "\t.space\t";
207207
CommentString = "#";
208+
AllowDollarAtStartOfIdentifier = false;
208209
SupportsDebugInformation = true;
209210
DwarfRegNumForCFI = true;
210211
ExceptionsType = ExceptionHandling::DwarfCFI;

llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ MipsELFMCAsmInfo::MipsELFMCAsmInfo(const Triple &TheTriple,
4040
Data32bitsDirective = "\t.4byte\t";
4141
Data64bitsDirective = "\t.8byte\t";
4242
CommentString = "#";
43+
AllowDollarAtStartOfIdentifier = false;
4344
ZeroDirective = "\t.space\t";
4445
UseAssignmentForEHBegin = true;
4546
SupportsDebugInformation = true;

llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ PPCELFMCAsmInfo::PPCELFMCAsmInfo(bool is64Bit, const Triple& T) {
192192
SupportsDebugInformation = true;
193193

194194
DollarIsPC = true;
195+
AllowDollarAtStartOfIdentifier = false;
195196

196197
// Set up DWARF directives
197198
MinInstAlignment = 4;
@@ -237,6 +238,7 @@ PPCXCOFFMCAsmInfo::PPCXCOFFMCAsmInfo(bool Is64Bit, const Triple &T) {
237238

238239
// Support $ as PC in inline asm
239240
DollarIsPC = true;
241+
AllowDollarAtStartOfIdentifier = false;
240242

241243
UsesSetToEquateSymbol = true;
242244

llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ X86MCAsmInfoDarwin::X86MCAsmInfoDarwin(const Triple &T) {
8585
// wasn't always case preserving or something.
8686
CommentString = "##";
8787

88+
AllowDollarAtStartOfIdentifier = false;
89+
8890
SupportsDebugInformation = true;
8991
UseDataRegionDirectives = MarkedJTDataRegions;
9092

@@ -124,6 +126,7 @@ X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &T) {
124126
CalleeSaveStackSlotSize = is64Bit ? 8 : 4;
125127

126128
AssemblerDialect = X86AsmSyntax;
129+
AllowDollarAtStartOfIdentifier = false;
127130

128131
// Debug Information
129132
SupportsDebugInformation = true;
@@ -162,6 +165,7 @@ X86MCAsmInfoMicrosoft::X86MCAsmInfoMicrosoft(const Triple &Triple) {
162165
ExceptionsType = ExceptionHandling::WinEH;
163166

164167
AssemblerDialect = X86AsmSyntax;
168+
AllowDollarAtStartOfIdentifier = false;
165169

166170
AllowAtInName = true;
167171

@@ -199,6 +203,7 @@ X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(const Triple &Triple) {
199203
AssemblerDialect = X86AsmSyntax;
200204

201205
AllowAtInName = true;
206+
AllowDollarAtStartOfIdentifier = false;
202207

203208
initializeAtSpecifiers(atSpecifiers);
204209
}

0 commit comments

Comments
 (0)