LLVM  3.7.0
NVPTXMCAsmInfo.cpp
Go to the documentation of this file.
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"
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 
29  if (TheTriple.getArch() == Triple::nvptx64) {
31  }
32 
33  CommentString = "//";
34 
36 
37  InlineAsmStart = " inline asm";
38  InlineAsmEnd = " inline asm";
39 
41  // PTX does not allow .align on functions.
42  HasFunctionAlignment = false;
44 
45  Data8bitsDirective = " .b8 ";
46  Data16bitsDirective = " .b16 ";
47  Data32bitsDirective = " .b32 ";
48  Data64bitsDirective = " .b64 ";
49  ZeroDirective = " .b8";
50  AsciiDirective = " .b8";
51  AscizDirective = " .b8";
52 
53  // @TODO: Can we just disable this?
54  WeakDirective = "\t// .weak\t";
55  GlobalDirective = "\t// .globl\t";
56 }
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition: MCAsmInfo.h:273
const char * WeakDirective
Used to declare a global as being a weak symbol. Defaults to ".weak".
Definition: MCAsmInfo.h:284
const char * Data64bitsDirective
Definition: MCAsmInfo.h:191
const char * ZeroDirective
This should be set to the directive used to get some number of zero bytes emitted to the current sect...
Definition: MCAsmInfo.h:173
const char * GlobalDirective
This is the directive used to declare a global entity.
Definition: MCAsmInfo.h:231
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:69
static cl::opt< bool > CompileForDebugging("debug-compile", cl::desc("Compile for debugging"), cl::Hidden, cl::init(false))
bool HasDotTypeDotSizeDirective
True if the target has .type and .size directives, this is true for most ELF targets.
Definition: MCAsmInfo.h:269
const char * AsciiDirective
This directive allows emission of an ascii string with the standard C escape characters embedded into...
Definition: MCAsmInfo.h:177
const char * Data8bitsDirective
These directives are used to output some unit of integer data to the current section.
Definition: MCAsmInfo.h:188
bool HasFunctionAlignment
Definition: MCAsmInfo.h:265
const char * CommentString
This indicates the comment character used by the assembler.
Definition: MCAsmInfo.h:113
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:242
const char * AscizDirective
If not null, this allows for special handling of zero terminated strings on this target.
Definition: MCAsmInfo.h:182
NVPTXMCAsmInfo(const Triple &TheTriple)
const char * InlineAsmStart
If these are nonempty, they contain a directive to emit before and after an inline assembly statement...
Definition: MCAsmInfo.h:141
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:325
unsigned PointerSize
Pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:65
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:318
const char * Data16bitsDirective
Definition: MCAsmInfo.h:189
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
const char * InlineAsmEnd
Definition: MCAsmInfo.h:142
const char * Data32bitsDirective
Definition: MCAsmInfo.h:190