LLVM  13.0.0git
NVPTXMCAsmInfo.cpp
Go to the documentation of this file.
1 //===-- NVPTXMCAsmInfo.cpp - NVPTX asm properties -------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the NVPTXMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "NVPTXMCAsmInfo.h"
14 #include "llvm/ADT/Triple.h"
15 
16 using namespace llvm;
17 
18 void NVPTXMCAsmInfo::anchor() {}
19 
21  const MCTargetOptions &Options) {
22  if (TheTriple.getArch() == Triple::nvptx64) {
24  }
25 
26  CommentString = "//";
27 
29 
30  InlineAsmStart = " begin inline asm";
31  InlineAsmEnd = " end inline asm";
32 
34  // PTX does not allow .align on functions.
35  HasFunctionAlignment = false;
37  // PTX does not allow .hidden or .protected
40 
41  Data8bitsDirective = ".b8 ";
42  Data16bitsDirective = nullptr; // not supported
43  Data32bitsDirective = ".b32 ";
44  Data64bitsDirective = ".b64 ";
45  ZeroDirective = ".b8";
46  AsciiDirective = nullptr; // not supported
47  AscizDirective = nullptr; // not supported
48  SupportsQuotedNames = false;
50  SupportsSignedData = false;
51 
52  // @TODO: Can we just disable this?
53  WeakDirective = "\t// .weak\t";
54  GlobalDirective = "\t// .globl\t";
55 
56  UseIntegratedAssembler = false;
57 }
llvm::MCAsmInfo::SupportsExtendedDwarfLocDirective
bool SupportsExtendedDwarfLocDirective
True if the target supports flags in ".loc" directive, false if only location is allowed.
Definition: MCAsmInfo.h:409
llvm
This class represents lattice values for constants.
Definition: AllocatorList.h:23
llvm::MCAsmInfo::HasFunctionAlignment
bool HasFunctionAlignment
Definition: MCAsmInfo.h:317
llvm::MCSA_Invalid
@ MCSA_Invalid
Not a valid directive.
Definition: MCDirectives.h:19
llvm::MCAsmInfo::SupportsDebugInformation
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:375
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::NVPTXMCAsmInfo::NVPTXMCAsmInfo
NVPTXMCAsmInfo(const Triple &TheTriple, const MCTargetOptions &Options)
Definition: NVPTXMCAsmInfo.cpp:20
llvm::MCAsmInfo::InlineAsmEnd
const char * InlineAsmEnd
Definition: MCAsmInfo.h:156
NVPTXMCAsmInfo.h
llvm::MCAsmInfo::Data64bitsDirective
const char * Data64bitsDirective
Definition: MCAsmInfo.h:232
llvm::MCAsmInfo::WeakDirective
const char * WeakDirective
Used to declare a global as being a weak symbol. Defaults to ".weak".
Definition: MCAsmInfo.h:340
llvm::MCAsmInfo::Data32bitsDirective
const char * Data32bitsDirective
Definition: MCAsmInfo.h:231
llvm::MCAsmInfo::ProtectedVisibilityAttr
MCSymbolAttr ProtectedVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare a symbol as having protected visibility.
Definition: MCAsmInfo.h:369
llvm::MCAsmInfo::HasSingleParameterDotFile
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition: MCAsmInfo.h:325
llvm::Triple::nvptx64
@ nvptx64
Definition: Triple.h:86
llvm::MCAsmInfo::UseIntegratedAssembler
bool UseIntegratedAssembler
Should we use the integrated assembler? The integrated assembler should be enabled by default (by the...
Definition: MCAsmInfo.h:428
llvm::Triple::getArch
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:305
llvm::MCAsmInfo::HasDotTypeDotSizeDirective
bool HasDotTypeDotSizeDirective
True if the target has .type and .size directives, this is true for most ELF targets.
Definition: MCAsmInfo.h:321
llvm::MCAsmInfo::SupportsSignedData
bool SupportsSignedData
True if data directives support signed values.
Definition: MCAsmInfo.h:235
llvm::MCAsmInfo::CommentString
StringRef CommentString
This indicates the comment character used by the assembler.
Definition: MCAsmInfo.h:127
llvm::MCAsmInfo::CodePointerSize
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:72
llvm::MCAsmInfo::ZeroDirective
const char * ZeroDirective
This should be set to the directive used to get some number of zero (and non-zero if supported by the...
Definition: MCAsmInfo.h:198
llvm::MCAsmInfo::Data16bitsDirective
const char * Data16bitsDirective
Definition: MCAsmInfo.h:230
llvm::MCAsmInfo::HiddenDeclarationVisibilityAttr
MCSymbolAttr HiddenDeclarationVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare an undefined symbol as having hidden visibili...
Definition: MCAsmInfo.h:365
llvm::MCTargetOptions
Definition: MCTargetOptions.h:36
Triple.h
llvm::MCAsmInfo::GlobalDirective
const char * GlobalDirective
This is the directive used to declare a global entity.
Definition: MCAsmInfo.h:283
llvm::MCAsmInfo::Data8bitsDirective
const char * Data8bitsDirective
These directives are used to output some unit of integer data to the current section.
Definition: MCAsmInfo.h:229
llvm::MCAsmInfo::InlineAsmStart
const char * InlineAsmStart
If these are nonempty, they contain a directive to emit before and after an inline assembly statement...
Definition: MCAsmInfo.h:155
llvm::MCAsmInfo::AscizDirective
const char * AscizDirective
If not null, this allows for special handling of zero terminated strings on this target.
Definition: MCAsmInfo.h:213
llvm::MCAsmInfo::CalleeSaveStackSlotSize
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:76
llvm::MCAsmInfo::HiddenVisibilityAttr
MCSymbolAttr HiddenVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare a symbol as having hidden visibility.
Definition: MCAsmInfo.h:361
llvm::MCAsmInfo::AsciiDirective
const char * AsciiDirective
This directive allows emission of an ascii string with the standard C escape characters embedded into...
Definition: MCAsmInfo.h:208
llvm::MCAsmInfo::SupportsQuotedNames
bool SupportsQuotedNames
If this is true, symbol names with invalid characters will be printed in quotes.
Definition: MCAsmInfo.h:178