blob: 8c04db1faf73d0e817658f16296cf423cde4a402 [file] [log] [blame]
Justin Holewinskiae556d32012-05-04 20:18:50 +00001//===-- 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"
Daniel Sanders50f17232015-09-15 16:17:27 +000015#include "llvm/ADT/Triple.h"
Justin Holewinskiae556d32012-05-04 20:18:50 +000016#include "llvm/Support/CommandLine.h"
17
18using namespace llvm;
19
Justin Holewinskiae556d32012-05-04 20:18:50 +000020// -debug-compile - Command line option to inform opt and llc passes to
21// compile for debugging
Benjamin Kramerad5c24f2013-05-23 16:09:15 +000022static cl::opt<bool> CompileForDebugging("debug-compile",
23 cl::desc("Compile for debugging"),
24 cl::Hidden, cl::init(false));
Justin Holewinskiae556d32012-05-04 20:18:50 +000025
Justin Holewinski0497ab12013-03-30 14:29:21 +000026void NVPTXMCAsmInfo::anchor() {}
Justin Holewinskiae556d32012-05-04 20:18:50 +000027
Daniel Sanders50f17232015-09-15 16:17:27 +000028NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple) {
29 if (TheTriple.getArch() == Triple::nvptx64) {
Eli Bendersky32aab222013-01-23 16:22:04 +000030 PointerSize = CalleeSaveStackSlotSize = 8;
31 }
Justin Holewinskiae556d32012-05-04 20:18:50 +000032
33 CommentString = "//";
34
Justin Holewinskiae556d32012-05-04 20:18:50 +000035 HasSingleParameterDotFile = false;
36
37 InlineAsmStart = " inline asm";
38 InlineAsmEnd = " inline asm";
39
40 SupportsDebugInformation = CompileForDebugging;
Jingyue Wue8290f22015-03-12 01:50:30 +000041 // PTX does not allow .align on functions.
42 HasFunctionAlignment = false;
Justin Holewinskiae556d32012-05-04 20:18:50 +000043 HasDotTypeDotSizeDirective = false;
Artem Belevich5be0706e2016-01-15 23:57:53 +000044 // PTX does not allow .hidden or .protected
45 HiddenDeclarationVisibilityAttr = HiddenVisibilityAttr = MCSA_Invalid;
46 ProtectedVisibilityAttr = MCSA_Invalid;
Justin Holewinskiae556d32012-05-04 20:18:50 +000047
48 Data8bitsDirective = " .b8 ";
49 Data16bitsDirective = " .b16 ";
50 Data32bitsDirective = " .b32 ";
51 Data64bitsDirective = " .b64 ";
Justin Holewinski0497ab12013-03-30 14:29:21 +000052 ZeroDirective = " .b8";
Justin Holewinskiae556d32012-05-04 20:18:50 +000053 AsciiDirective = " .b8";
54 AscizDirective = " .b8";
55
56 // @TODO: Can we just disable this?
Jingyue Wu5b62eb92014-12-01 21:16:17 +000057 WeakDirective = "\t// .weak\t";
Justin Holewinskiae556d32012-05-04 20:18:50 +000058 GlobalDirective = "\t// .globl\t";
59}