MCAsmInfoXCOFF.cpp 2.3 KB

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