[NVPTX] Do not emit .weak symbols for NVPTX
[oota-llvm.git] / lib / Target / NVPTX / MCTargetDesc / NVPTXMCAsmInfo.cpp
1 //===-- 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
18 using namespace llvm;
19
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));
25
26 void NVPTXMCAsmInfo::anchor() {}
27
28 NVPTXMCAsmInfo::NVPTXMCAsmInfo(StringRef TT) {
29   Triple TheTriple(TT);
30   if (TheTriple.getArch() == Triple::nvptx64) {
31     PointerSize = CalleeSaveStackSlotSize = 8;
32   }
33
34   CommentString = "//";
35
36   HasSingleParameterDotFile = false;
37
38   InlineAsmStart = " inline asm";
39   InlineAsmEnd = " inline asm";
40
41   SupportsDebugInformation = CompileForDebugging;
42   HasDotTypeDotSizeDirective = false;
43
44   Data8bitsDirective = " .b8 ";
45   Data16bitsDirective = " .b16 ";
46   Data32bitsDirective = " .b32 ";
47   Data64bitsDirective = " .b64 ";
48   ZeroDirective = " .b8";
49   AsciiDirective = " .b8";
50   AscizDirective = " .b8";
51
52   // @TODO: Can we just disable this?
53   WeakDirective = "\t// .weak\t";
54   GlobalDirective = "\t// .globl\t";
55 }