1 //===-- SystemZMCAsmInfo.cpp - SystemZ asm properties ---------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "SystemZMCAsmInfo.h"
10 #include "llvm/MC/MCContext.h"
11 #include "llvm/MC/MCSectionELF.h"
12 
13 using namespace llvm;
14 
15 SystemZMCAsmInfo::SystemZMCAsmInfo(const Triple &TT) {
16   CodePointerSize = 8;
17   CalleeSaveStackSlotSize = 8;
18   IsLittleEndian = false;
19 
20   AssemblerDialect = TT.isOSzOS() ? AD_HLASM : AD_ATT;
21 
22   MaxInstLength = 6;
23 
24   CommentString = AssemblerDialect == AD_HLASM ? "*" : "#";
25   RestrictCommentStringToStartOfStatement = (AssemblerDialect == AD_HLASM);
26   AllowAdditionalComments = (AssemblerDialect == AD_ATT);
27   AllowAtAtStartOfIdentifier = (AssemblerDialect == AD_HLASM);
28   AllowDollarAtStartOfIdentifier = (AssemblerDialect == AD_HLASM);
29   AllowHashAtStartOfIdentifier = (AssemblerDialect == AD_HLASM);
30   DotIsPC = (AssemblerDialect == AD_ATT);
31   StarIsPC = (AssemblerDialect == AD_HLASM);
32   EmitGNUAsmStartIndentationMarker = (AssemblerDialect == AD_ATT);
33   AllowAtInName = (AssemblerDialect == AD_HLASM);
34   EmitLabelsInUpperCase = (AssemblerDialect == AD_HLASM);
35 
36   ZeroDirective = "\t.space\t";
37   Data64bitsDirective = "\t.quad\t";
38   UsesELFSectionDirectiveForBSS = true;
39   SupportsDebugInformation = true;
40   ExceptionsType = ExceptionHandling::DwarfCFI;
41 }
42 
43 bool SystemZMCAsmInfo::isAcceptableChar(char C) const {
44   if (AssemblerDialect == AD_ATT)
45     return MCAsmInfo::isAcceptableChar(C);
46 
47   return MCAsmInfo::isAcceptableChar(C) || C == '#';
48 }
49