1 //===-- NVPTXMCAsmInfo.cpp - NVPTX asm properties -------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declarations of the NVPTXMCAsmInfo properties.
12 //===----------------------------------------------------------------------===//
14 #include "NVPTXMCAsmInfo.h"
15 #include "llvm/ADT/Triple.h"
16 #include "llvm/Support/CommandLine.h"
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));
26 void NVPTXMCAsmInfo::anchor() {}
28 NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple) {
29 if (TheTriple.getArch() == Triple::nvptx64) {
30 PointerSize = CalleeSaveStackSlotSize = 8;
35 HasSingleParameterDotFile = false;
37 InlineAsmStart = " inline asm";
38 InlineAsmEnd = " inline asm";
40 SupportsDebugInformation = CompileForDebugging;
41 // PTX does not allow .align on functions.
42 HasFunctionAlignment = false;
43 HasDotTypeDotSizeDirective = false;
45 Data8bitsDirective = " .b8 ";
46 Data16bitsDirective = " .b16 ";
47 Data32bitsDirective = " .b32 ";
48 Data64bitsDirective = " .b64 ";
49 ZeroDirective = " .b8";
50 AsciiDirective = " .b8";
51 AscizDirective = " .b8";
53 // @TODO: Can we just disable this?
54 WeakDirective = "\t// .weak\t";
55 GlobalDirective = "\t// .globl\t";