1 //===- MC/MCAsmInfoXCOFF.cpp - XCOFF asm properties ------------ *- C++ -*-===// 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 "llvm/MC/MCAsmInfoXCOFF.h" 10 #include "llvm/ADT/StringExtras.h" 11 #include "llvm/Support/CommandLine.h" 12 13 using namespace llvm; 14 15 namespace llvm { 16 extern cl::opt<cl::boolOrDefault> UseLEB128Directives; 17 } 18 19 void MCAsmInfoXCOFF::anchor() {} 20 21 MCAsmInfoXCOFF::MCAsmInfoXCOFF() { 22 IsAIX = true; 23 IsLittleEndian = false; 24 25 PrivateGlobalPrefix = "L.."; 26 PrivateLabelPrefix = "L.."; 27 SupportsQuotedNames = false; 28 if (UseLEB128Directives == cl::BOU_UNSET) 29 HasLEB128Directives = false; 30 ZeroDirective = "\t.space\t"; 31 AsciiDirective = nullptr; // not supported 32 AscizDirective = nullptr; // not supported 33 CharacterLiteralSyntax = ACLS_SingleQuotePrefix; 34 35 // Use .vbyte for data definition to avoid directives that apply an implicit 36 // alignment. 37 Data16bitsDirective = "\t.vbyte\t2, "; 38 Data32bitsDirective = "\t.vbyte\t4, "; 39 40 COMMDirectiveAlignmentIsInBytes = false; 41 LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment; 42 HasDotTypeDotSizeDirective = false; 43 ParseInlineAsmUsingAsmParser = true; 44 45 ExceptionsType = ExceptionHandling::AIX; 46 } 47 48 bool MCAsmInfoXCOFF::isAcceptableChar(char C) const { 49 // QualName is allowed for a MCSymbolXCOFF, and 50 // QualName contains '[' and ']'. 51 if (C == '[' || C == ']') 52 return true; 53 54 // For AIX assembler, symbols may consist of numeric digits, 55 // underscores, periods, uppercase or lowercase letters, or 56 // any combination of these. 57 return isAlnum(C) || C == '_' || C == '.'; 58 } 59