@@ -24,8 +24,7 @@ static cl::opt<bool> EscapeNonPrint(
2424 " Avoid outputting non-printable ascii characters to assembly files." ),
2525 cl::Hidden);
2626
27- // TODO: Put this somewhere more appropriate for a global
28- cl::opt<bool > GasStyle (
27+ cl::opt<bool > Z80GasStyle (
2928 " z80-gas-style" ,
3029 cl::desc (" Use GAS style assembly syntax instead of FASMG style." ),
3130 cl::NotHidden);
@@ -36,8 +35,8 @@ Z80MCAsmInfoELF::Z80MCAsmInfoELF(const Triple &T) {
3635 bool Is16Bit = T.isArch16Bit () || T.getEnvironment () == Triple::CODE16;
3736 CodePointerSize = CalleeSaveStackSlotSize = Is16Bit ? 2 : 3 ;
3837 MaxInstLength = 6 ;
39-
40- if (!GasStyle ) {
38+
39+ if (!Z80GasStyle ) {
4140 DollarIsPC = true ;
4241 SeparatorString = nullptr ;
4342 CommentString = " ;" ;
@@ -92,7 +91,7 @@ MCSection *Z80MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const {
9291}
9392
9493bool Z80MCAsmInfoELF::isAcceptableChar (char C) const {
95- return MCAsmInfo::isAcceptableChar (C) || C == ' %' || C == ' ^' ;
94+ return Z80GasStyle ? MCAsmInfo::isAcceptableChar (C) : ( MCAsmInfo::isAcceptableChar (C) || C == ' %' || C == ' ^' ) ;
9695}
9796
9897bool Z80MCAsmInfoELF::shouldOmitSectionDirective (StringRef SectionName) const {
@@ -102,10 +101,10 @@ bool Z80MCAsmInfoELF::shouldOmitSectionDirective(StringRef SectionName) const {
102101const char *Z80MCAsmInfoELF::getBlockDirective (int64_t Size) const {
103102 switch (Size) {
104103 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 " ;
109108 }
110109}
111110
0 commit comments