blob: 619181994ae8a4f5af4054fdee9d63d22169d985 [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,
26 cl::location(CompileForDebugging),
27 cl::init(false));
28
29void NVPTXMCAsmInfo::anchor() { }
30
31NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Target &T, const StringRef &TT) {
32 Triple TheTriple(TT);
Eli Bendersky32aab222013-01-23 16:22:04 +000033 if (TheTriple.getArch() == Triple::nvptx64) {
34 PointerSize = CalleeSaveStackSlotSize = 8;
35 }
Justin Holewinskiae556d32012-05-04 20:18:50 +000036
37 CommentString = "//";
38
39 PrivateGlobalPrefix = "$L__";
40
41 AllowPeriodsInName = false;
42
43 HasSetDirective = false;
44
45 HasSingleParameterDotFile = false;
46
47 InlineAsmStart = " inline asm";
48 InlineAsmEnd = " inline asm";
49
50 SupportsDebugInformation = CompileForDebugging;
51 HasDotTypeDotSizeDirective = false;
52
53 Data8bitsDirective = " .b8 ";
54 Data16bitsDirective = " .b16 ";
55 Data32bitsDirective = " .b32 ";
56 Data64bitsDirective = " .b64 ";
57 PrivateGlobalPrefix = "";
58 ZeroDirective = " .b8";
59 AsciiDirective = " .b8";
60 AscizDirective = " .b8";
61
62 // @TODO: Can we just disable this?
63 GlobalDirective = "\t// .globl\t";
64}