blob: dfa1ff5f51ad293bf6fe11e3cf7335c1f318edb4 [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"
15#include "llvm/ADT/Triple.h"
16#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
Rafael Espindola140a8372013-05-10 18:16:59 +000028NVPTXMCAsmInfo::NVPTXMCAsmInfo(const StringRef &TT) {
Justin Holewinskiae556d32012-05-04 20:18:50 +000029 Triple TheTriple(TT);
Eli Bendersky32aab222013-01-23 16:22:04 +000030 if (TheTriple.getArch() == Triple::nvptx64) {
31 PointerSize = CalleeSaveStackSlotSize = 8;
32 }
Justin Holewinskiae556d32012-05-04 20:18:50 +000033
34 CommentString = "//";
35
36 PrivateGlobalPrefix = "$L__";
37
38 AllowPeriodsInName = false;
39
40 HasSetDirective = false;
41
42 HasSingleParameterDotFile = false;
43
44 InlineAsmStart = " inline asm";
45 InlineAsmEnd = " inline asm";
46
47 SupportsDebugInformation = CompileForDebugging;
48 HasDotTypeDotSizeDirective = false;
49
50 Data8bitsDirective = " .b8 ";
51 Data16bitsDirective = " .b16 ";
52 Data32bitsDirective = " .b32 ";
53 Data64bitsDirective = " .b64 ";
54 PrivateGlobalPrefix = "";
Justin Holewinski0497ab12013-03-30 14:29:21 +000055 ZeroDirective = " .b8";
Justin Holewinskiae556d32012-05-04 20:18:50 +000056 AsciiDirective = " .b8";
57 AscizDirective = " .b8";
58
59 // @TODO: Can we just disable this?
60 GlobalDirective = "\t// .globl\t";
61}