• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- NVPTXMCAsmInfo.cpp - NVPTX asm properties -------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declarations of the NVPTXMCAsmInfo properties.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "NVPTXMCAsmInfo.h"
15 #include "llvm/ADT/Triple.h"
16 #include "llvm/Support/CommandLine.h"
17 
18 using namespace llvm;
19 
20 // -debug-compile - Command line option to inform opt and llc passes to
21 // compile for debugging
22 static cl::opt<bool> CompileForDebugging("debug-compile",
23                                          cl::desc("Compile for debugging"),
24                                          cl::Hidden, cl::init(false));
25 
anchor()26 void NVPTXMCAsmInfo::anchor() {}
27 
NVPTXMCAsmInfo(const Triple & TheTriple)28 NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple) {
29   if (TheTriple.getArch() == Triple::nvptx64) {
30     PointerSize = CalleeSaveStackSlotSize = 8;
31   }
32 
33   CommentString = "//";
34 
35   HasSingleParameterDotFile = false;
36 
37   InlineAsmStart = " begin inline asm";
38   InlineAsmEnd = " end inline asm";
39 
40   SupportsDebugInformation = CompileForDebugging;
41   // PTX does not allow .align on functions.
42   HasFunctionAlignment = false;
43   HasDotTypeDotSizeDirective = false;
44   // PTX does not allow .hidden or .protected
45   HiddenDeclarationVisibilityAttr = HiddenVisibilityAttr = MCSA_Invalid;
46   ProtectedVisibilityAttr = MCSA_Invalid;
47 
48   Data8bitsDirective = " .b8 ";
49   Data16bitsDirective = " .b16 ";
50   Data32bitsDirective = " .b32 ";
51   Data64bitsDirective = " .b64 ";
52   ZeroDirective = " .b8";
53   AsciiDirective = " .b8";
54   AscizDirective = " .b8";
55 
56   // @TODO: Can we just disable this?
57   WeakDirective = "\t// .weak\t";
58   GlobalDirective = "\t// .globl\t";
59 }
60