MCAsmInfoXCOFF.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. extern cl::opt<cl::boolOrDefault> UseLEB128Directives;
  13. void MCAsmInfoXCOFF::anchor() {}
  14. MCAsmInfoXCOFF::MCAsmInfoXCOFF() {
  15. IsLittleEndian = false;
  16. HasVisibilityOnlyWithLinkage = true;
  17. PrivateGlobalPrefix = "L..";
  18. PrivateLabelPrefix = "L..";
  19. SupportsQuotedNames = false;
  20. UseDotAlignForAlignment = true;
  21. if (UseLEB128Directives == cl::BOU_UNSET)
  22. HasLEB128Directives = false;
  23. ZeroDirective = "\t.space\t";
  24. ZeroDirectiveSupportsNonZeroValue = false;
  25. AsciiDirective = nullptr; // not supported
  26. AscizDirective = nullptr; // not supported
  27. ByteListDirective = "\t.byte\t";
  28. CharacterLiteralSyntax = ACLS_SingleQuotePrefix;
  29. // Use .vbyte for data definition to avoid directives that apply an implicit
  30. // alignment.
  31. Data16bitsDirective = "\t.vbyte\t2, ";
  32. Data32bitsDirective = "\t.vbyte\t4, ";
  33. COMMDirectiveAlignmentIsInBytes = false;
  34. LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment;
  35. HasDotTypeDotSizeDirective = false;
  36. UseIntegratedAssembler = false;
  37. NeedsFunctionDescriptors = true;
  38. ExceptionsType = ExceptionHandling::AIX;
  39. }
  40. bool MCAsmInfoXCOFF::isAcceptableChar(char C) const {
  41. // QualName is allowed for a MCSymbolXCOFF, and
  42. // QualName contains '[' and ']'.
  43. if (C == '[' || C == ']')
  44. return true;
  45. // For AIX assembler, symbols may consist of numeric digits,
  46. // underscores, periods, uppercase or lowercase letters, or
  47. // any combination of these.
  48. return isAlnum(C) || C == '_' || C == '.';
  49. }