Skip to content

Commit 2b19d7a

Browse files
committed
Fix fixed-length character arrays producing invalid GAS syntax
1 parent 3c2b907 commit 2b19d7a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

llvm/lib/Target/Z80/MCTargetDesc/Z80MCAsmInfo.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,24 @@ Z80MCAsmInfoELF::Z80MCAsmInfoELF(const Triple &T) {
3838

3939
// Common to both GAS and fasmg
4040
CommentString = ";";
41+
ZeroDirective = AscizDirective = nullptr;
4142
Code32Directive = Code64Directive = nullptr;
4243
UseIntegratedAssembler = false;
4344
AssemblerDialect = !Is16Bit;
4445
HasFunctionAlignment = false;
4546
ExceptionsType = ExceptionHandling::SjLj;
4647

47-
if (!Z80GasStyle) {
48+
if (Z80GasStyle) {
49+
Code16Directive = ".assume ADL = 0";
50+
Code24Directive = ".assume ADL = 1";
51+
AsciiDirective = ByteListDirective = Data8bitsDirective = "\t.byte\t";
52+
} else {
4853
Code16Directive = "assume\tadl = 0";
4954
Code24Directive = "assume\tadl = 1";
5055
DollarIsPC = true;
5156
SeparatorString = nullptr;
5257
PrivateGlobalPrefix = PrivateLabelPrefix = "";
5358
SupportsQuotedNames = false;
54-
ZeroDirective = AscizDirective = nullptr;
5559
BlockSeparator = " dup ";
5660
AsciiDirective = ByteListDirective = Data8bitsDirective = "\tdb\t";
5761
NumberLiteralSyntax = ANLS_PlainDecimal;

0 commit comments

Comments
 (0)