@@ -24,8 +24,7 @@ static cl::opt<bool> EscapeNonPrint(
24
24
" Avoid outputting non-printable ascii characters to assembly files." ),
25
25
cl::Hidden);
26
26
27
- // TODO: Put this somewhere more appropriate for a global
28
- cl::opt<bool > GasStyle (
27
+ cl::opt<bool > Z80GasStyle (
29
28
" z80-gas-style" ,
30
29
cl::desc (" Use GAS style assembly syntax instead of FASMG style." ),
31
30
cl::NotHidden);
@@ -36,8 +35,8 @@ Z80MCAsmInfoELF::Z80MCAsmInfoELF(const Triple &T) {
36
35
bool Is16Bit = T.isArch16Bit () || T.getEnvironment () == Triple::CODE16;
37
36
CodePointerSize = CalleeSaveStackSlotSize = Is16Bit ? 2 : 3 ;
38
37
MaxInstLength = 6 ;
39
-
40
- if (!GasStyle ) {
38
+
39
+ if (!Z80GasStyle ) {
41
40
DollarIsPC = true ;
42
41
SeparatorString = nullptr ;
43
42
CommentString = " ;" ;
@@ -92,7 +91,7 @@ MCSection *Z80MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const {
92
91
}
93
92
94
93
bool Z80MCAsmInfoELF::isAcceptableChar (char C) const {
95
- return MCAsmInfo::isAcceptableChar (C) || C == ' %' || C == ' ^' ;
94
+ return Z80GasStyle ? MCAsmInfo::isAcceptableChar (C) : ( MCAsmInfo::isAcceptableChar (C) || C == ' %' || C == ' ^' ) ;
96
95
}
97
96
98
97
bool Z80MCAsmInfoELF::shouldOmitSectionDirective (StringRef SectionName) const {
@@ -102,10 +101,10 @@ bool Z80MCAsmInfoELF::shouldOmitSectionDirective(StringRef SectionName) const {
102
101
const char *Z80MCAsmInfoELF::getBlockDirective (int64_t Size ) const {
103
102
switch (Size ) {
104
103
default : return nullptr ;
105
- case 1 : return GasStyle ? " \t .byte" : " \t db\t " ;
106
- case 2 : return GasStyle ? " \t .short" : " \t dw\t " ;
107
- case 3 : return GasStyle ? " \t .long" : " \t dl\t " ;
108
- case 4 : return GasStyle ? " \t .quad" : " \t dd\t " ;
104
+ case 1 : return Z80GasStyle ? " \t .byte" : " \t db\t " ;
105
+ case 2 : return Z80GasStyle ? " \t .short" : " \t dw\t " ;
106
+ case 3 : return Z80GasStyle ? " \t .long" : " \t dl\t " ;
107
+ case 4 : return Z80GasStyle ? " \t .quad" : " \t dd\t " ;
109
108
}
110
109
}
111
110
0 commit comments