NVPTXMCAsmInfo.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //===-- NVPTXMCAsmInfo.cpp - NVPTX 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. // This file contains the declarations of the NVPTXMCAsmInfo properties.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #include "NVPTXMCAsmInfo.h"
  13. #include "llvm/ADT/Triple.h"
  14. using namespace llvm;
  15. void NVPTXMCAsmInfo::anchor() {}
  16. NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple,
  17. const MCTargetOptions &Options) {
  18. if (TheTriple.getArch() == Triple::nvptx64) {
  19. CodePointerSize = CalleeSaveStackSlotSize = 8;
  20. }
  21. CommentString = "//";
  22. HasSingleParameterDotFile = false;
  23. InlineAsmStart = " begin inline asm";
  24. InlineAsmEnd = " end inline asm";
  25. SupportsDebugInformation = true;
  26. // PTX does not allow .align on functions.
  27. HasFunctionAlignment = false;
  28. HasDotTypeDotSizeDirective = false;
  29. // PTX does not allow .hidden or .protected
  30. HiddenDeclarationVisibilityAttr = HiddenVisibilityAttr = MCSA_Invalid;
  31. ProtectedVisibilityAttr = MCSA_Invalid;
  32. Data8bitsDirective = ".b8 ";
  33. Data16bitsDirective = nullptr; // not supported
  34. Data32bitsDirective = ".b32 ";
  35. Data64bitsDirective = ".b64 ";
  36. ZeroDirective = ".b8";
  37. AsciiDirective = nullptr; // not supported
  38. AscizDirective = nullptr; // not supported
  39. SupportsQuotedNames = false;
  40. SupportsExtendedDwarfLocDirective = false;
  41. SupportsSignedData = false;
  42. // @TODO: Can we just disable this?
  43. WeakDirective = "\t// .weak\t";
  44. GlobalDirective = "\t// .globl\t";
  45. UseIntegratedAssembler = false;
  46. }