Sean Fertile | f09d54e | 2019-07-09 19:21:01 +0000 | [diff] [blame] | 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" |
jasonliu | 6d3ae36 | 2020-07-06 14:18:06 +0000 | [diff] [blame] | 10 | #include "llvm/ADT/StringExtras.h" |
Sean Fertile | f09d54e | 2019-07-09 19:21:01 +0000 | [diff] [blame] | 11 | |
| 12 | using namespace llvm; |
| 13 | |
| 14 | void MCAsmInfoXCOFF::anchor() {} |
| 15 | |
| 16 | MCAsmInfoXCOFF::MCAsmInfoXCOFF() { |
| 17 | IsLittleEndian = false; |
diggerlin | edd819c | 2020-06-09 16:15:06 -0400 | [diff] [blame] | 18 | HasVisibilityOnlyWithLinkage = true; |
jasonliu | f5415f7 | 2020-06-03 16:23:12 +0000 | [diff] [blame] | 19 | PrivateGlobalPrefix = "L.."; |
| 20 | PrivateLabelPrefix = "L.."; |
Hubert Tong | a3515ab | 2020-04-30 20:44:04 -0400 | [diff] [blame] | 21 | SupportsQuotedNames = false; |
Xing Xue | ef039a3 | 2019-08-25 15:17:25 +0000 | [diff] [blame] | 22 | UseDotAlignForAlignment = true; |
Hubert Tong | a3515ab | 2020-04-30 20:44:04 -0400 | [diff] [blame] | 23 | ZeroDirective = "\t.space\t"; |
| 24 | ZeroDirectiveSupportsNonZeroValue = false; |
Xing Xue | ef039a3 | 2019-08-25 15:17:25 +0000 | [diff] [blame] | 25 | AsciiDirective = nullptr; // not supported |
| 26 | AscizDirective = nullptr; // not supported |
Hubert Tong | 0a146a9 | 2020-09-29 21:11:16 -0400 | [diff] [blame] | 27 | ByteListDirective = "\t.byte\t"; |
| 28 | CharacterLiteralSyntax = ACLS_SingleQuotePrefix; |
David Tenty | d20fdca | 2020-06-03 10:54:56 -0400 | [diff] [blame] | 29 | |
| 30 | // Use .vbyte for data definition to avoid directives that apply an implicit |
| 31 | // alignment. |
| 32 | Data16bitsDirective = "\t.vbyte\t2, "; |
| 33 | Data32bitsDirective = "\t.vbyte\t4, "; |
| 34 | |
Hubert Tong | a3515ab | 2020-04-30 20:44:04 -0400 | [diff] [blame] | 35 | COMMDirectiveAlignmentIsInBytes = false; |
| 36 | LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment; |
| 37 | HasDotTypeDotSizeDirective = false; |
Hubert Tong | a3515ab | 2020-04-30 20:44:04 -0400 | [diff] [blame] | 38 | UseIntegratedAssembler = false; |
| 39 | NeedsFunctionDescriptors = true; |
Xiangling Liao | 3b808fb | 2019-09-26 19:38:32 +0000 | [diff] [blame] | 40 | } |
| 41 | |
Jason Liu | 0dc0572 | 2019-11-08 09:26:28 -0500 | [diff] [blame] | 42 | bool MCAsmInfoXCOFF::isAcceptableChar(char C) const { |
| 43 | // QualName is allowed for a MCSymbolXCOFF, and |
| 44 | // QualName contains '[' and ']'. |
| 45 | if (C == '[' || C == ']') |
Xiangling Liao | 3b808fb | 2019-09-26 19:38:32 +0000 | [diff] [blame] | 46 | return true; |
| 47 | |
jasonliu | 6d3ae36 | 2020-07-06 14:18:06 +0000 | [diff] [blame] | 48 | // For AIX assembler, symbols may consist of numeric digits, |
| 49 | // underscores, periods, uppercase or lowercase letters, or |
| 50 | // any combination of these. |
| 51 | return isAlnum(C) || C == '_' || C == '.'; |
Sean Fertile | f09d54e | 2019-07-09 19:21:01 +0000 | [diff] [blame] | 52 | } |