blob: 459cd96cb0cda268cc3f78aba8bd7e1403a9cafe [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
20bool CompileForDebugging;
21
22// -debug-compile - Command line option to inform opt and llc passes to
23// compile for debugging
24static cl::opt<bool, true>
25Debug("debug-compile", cl::desc("Compile for debugging"), cl::Hidden,
Justin Holewinski0497ab12013-03-30 14:29:21 +000026 cl::location(CompileForDebugging), cl::init(false));
Justin Holewinskiae556d32012-05-04 20:18:50 +000027
Justin Holewinski0497ab12013-03-30 14:29:21 +000028void NVPTXMCAsmInfo::anchor() {}
Justin Holewinskiae556d32012-05-04 20:18:50 +000029
30NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Target &T, const StringRef &TT) {
31 Triple TheTriple(TT);
Eli Bendersky32aab222013-01-23 16:22:04 +000032 if (TheTriple.getArch() == Triple::nvptx64) {
33 PointerSize = CalleeSaveStackSlotSize = 8;
34 }
Justin Holewinskiae556d32012-05-04 20:18:50 +000035
36 CommentString = "//";
37
38 PrivateGlobalPrefix = "$L__";
39
40 AllowPeriodsInName = false;
41
42 HasSetDirective = false;
43
44 HasSingleParameterDotFile = false;
45
46 InlineAsmStart = " inline asm";
47 InlineAsmEnd = " inline asm";
48
49 SupportsDebugInformation = CompileForDebugging;
50 HasDotTypeDotSizeDirective = false;
51
52 Data8bitsDirective = " .b8 ";
53 Data16bitsDirective = " .b16 ";
54 Data32bitsDirective = " .b32 ";
55 Data64bitsDirective = " .b64 ";
56 PrivateGlobalPrefix = "";
Justin Holewinski0497ab12013-03-30 14:29:21 +000057 ZeroDirective = " .b8";
Justin Holewinskiae556d32012-05-04 20:18:50 +000058 AsciiDirective = " .b8";
59 AscizDirective = " .b8";
60
61 // @TODO: Can we just disable this?
62 GlobalDirective = "\t// .globl\t";
63}