LLVM  4.0.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 = " begin inline asm";
38  InlineAsmEnd = " end inline asm";
39 
41  // PTX does not allow .align on functions.
42  HasFunctionAlignment = false;
44  // PTX does not allow .hidden or .protected
47 
48  Data8bitsDirective = " .b8 ";
49  Data16bitsDirective = " .b16 ";
50  Data32bitsDirective = " .b32 ";
51  Data64bitsDirective = " .b64 ";
52  ZeroDirective = " .b8";
53  AsciiDirective = " .b8";
54  AscizDirective = " .b8";
55 
56  // @TODO: Can we just disable this?
57  WeakDirective = "\t// .weak\t";
58  GlobalDirective = "\t// .globl\t";
59 }
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition: MCAsmInfo.h:274
const char * WeakDirective
Used to declare a global as being a weak symbol. Defaults to ".weak".
Definition: MCAsmInfo.h:289
Not a valid directive.
Definition: MCDirectives.h:20
const char * Data64bitsDirective
Definition: MCAsmInfo.h:184
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:166
const char * GlobalDirective
This is the directive used to declare a global entity.
Definition: MCAsmInfo.h:232
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:68
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:270
const char * AsciiDirective
This directive allows emission of an ascii string with the standard C escape characters embedded into...
Definition: MCAsmInfo.h:170
StringRef CommentString
This indicates the comment character used by the assembler.
Definition: MCAsmInfo.h:106
const char * Data8bitsDirective
These directives are used to output some unit of integer data to the current section.
Definition: MCAsmInfo.h:181
bool HasFunctionAlignment
Definition: MCAsmInfo.h:266
MCSymbolAttr HiddenVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare a symbol as having hidden visibility...
Definition: MCAsmInfo.h:309
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:270
const char * AscizDirective
If not null, this allows for special handling of zero terminated strings on this target.
Definition: MCAsmInfo.h:175
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:134
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:395
unsigned PointerSize
Pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:64
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:323
const char * Data16bitsDirective
Definition: MCAsmInfo.h:182
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
const char * InlineAsmEnd
Definition: MCAsmInfo.h:135
const char * Data32bitsDirective
Definition: MCAsmInfo.h:183
MCSymbolAttr ProtectedVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare a symbol as having protected visibility...
Definition: MCAsmInfo.h:317
MCSymbolAttr HiddenDeclarationVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare an undefined symbol as having hidden visibili...
Definition: MCAsmInfo.h:313