15#ifndef LLVM_MC_MCASMINFO_H
16#define LLVM_MC_MCASMINFO_H
26class MCCFIInstruction;
This class is intended to be used as a base class for asm properties and features specific to the tar...
StringRef getPrivateGlobalPrefix() const
bool RestrictCommentStringToStartOfStatement
This indicates whether the comment string is only accepted as a comment at the beginning of statement...
bool needsFunctionDescriptors() const
const char * Data16bitsDirective
bool hasCOFFAssociativeComdats() const
void addInitialFrameState(const MCCFIInstruction &Inst)
bool NeedsDwarfSectionOffsetDirective
bool useParensForSymbolVariant() const
const char * getPlainStringDirective() const
const char * getLabelSuffix() const
void setAllowAtInName(bool V)
MCSymbolAttr ExportedVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare a symbol as having exported visibility.
bool preserveAsmComments() const
Return true if assembly (inline or otherwise) should be parsed.
bool supportsSignedData() const
const char * getInlineAsmStart() const
const char * DTPRel32Directive
If non-null, directives that are used to emit a word/dword which should be relocated as a 32/64-bit D...
bool hasDotTypeDotSizeDirective() const
bool isLittleEndian() const
True if the target is little endian.
unsigned MinInstAlignment
Every possible instruction length is a multiple of this value.
bool HasNoDeadStrip
True if this target supports the MachO .no_dead_strip directive.
bool AllowAdditionalComments
This indicates whether to allow additional "comment strings" to be lexed as a comment.
const char * PlainStringDirective
This directive allows emission of a zero-terminated ascii string without the standard C escape charac...
unsigned TextAlignFillValue
If non-zero, this is used to fill the executable space created as the result of a alignment directive...
bool AllowQuestionAtStartOfIdentifier
This is true if the assembler allows the "?" character at the start of of a string to be lexed as an ...
bool useIntegratedAssembler() const
Return true if assembly (inline or otherwise) should be parsed.
MCSymbolAttr ProtectedVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare a symbol as having protected visibility.
bool HasFunctionAlignment
bool HasBasenameOnlyForFileDirective
True if the target only has basename for .file directive.
const char * AsciiDirective
This directive allows emission of an ascii string with the standard C escape characters embedded into...
bool hasBasenameOnlyForFileDirective() const
std::vector< MCCFIInstruction > InitialFrameState
bool getRestrictCommentStringToStartOfStatement() const
MCSymbolAttr getProtectedVisibilityAttr() const
bool usesSunStyleELFSectionSwitchSyntax() const
bool doesAllowDollarAtStartOfIdentifier() const
const char * Code64Directive
virtual unsigned getMaxInstLength(const MCSubtargetInfo *STI=nullptr) const
Returns the maximum possible encoded instruction size in bytes.
unsigned getMinInstAlignment() const
bool hasLEB128Directives() const
bool doesSupportDataRegionDirectives() const
const char * Code32Directive
MCSymbolAttr getExportedVisibilityAttr() const
const char * ByteListDirective
This directive accepts a comma-separated list of bytes for emission as a string of bytes.
bool HasSubsectionsViaSymbols
True if this target has the MachO .subsections_via_symbols directive.
const char * getTPRel64Directive() const
bool HasFourStringsDotFile
True if the target has a four strings .file directive, strings separated by comma.
const char * getData32bitsDirective() const
const char * Data8bitsDirective
These directives are used to output some unit of integer data to the current section.
const char * Data64bitsDirective
const std::vector< MCCFIInstruction > & getInitialFrameState() const
const char * DTPRel64Directive
bool useFullRegisterNames() const
bool hasFourStringsDotFile() const
unsigned getAssemblerDialect() const
virtual void setUseIntegratedAssembler(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
bool DollarIsPC
The '$' token, when not referencing an identifier or constant, refers to the current PC.
const char * getInlineAsmEnd() const
bool HasVisibilityOnlyWithLinkage
True if this is an XCOFF target that supports visibility attributes as part of .global,...
unsigned getTextAlignFillValue() const
StringRef getLinkerPrivateGlobalPrefix() const
bool doesAllowAtInName() const
bool useDwarfRegNumForCFI() const
bool useAssignmentForEHBegin() const
bool usesCFIWithoutEH() const
bool hasMipsExpressions() const
bool supportsExtendedDwarfLocDirective() const
bool AvoidWeakIfComdat
True if we should mark symbols as global instead of weak, for weak*/linkonce*, if the symbol has a c...
bool UsesDwarfFileAndLocDirectives
True if the target supports generating the DWARF line table through using the .loc/....
StringRef getPrivateLabelPrefix() const
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
bool shouldEmitLabelsInUpperCase() const
bool AllowDollarAtStartOfIdentifier
This is true if the assembler allows the "$" character at the start of of a string to be lexed as an ...
bool PreserveAsmComments
Preserve Comments in assembly.
const char * LabelSuffix
This is appended to emitted labels. Defaults to ":".
StringRef PrivateGlobalPrefix
This prefix is used for globals like constant pool entries that are completely private to the ....
bool DwarfFDESymbolsUseAbsDiff
True if DWARF FDE symbol reference relocations should be replaced by an absolute difference.
const char * getData8bitsDirective() const
const char * getTPRel32Directive() const
const char * TPRel64Directive
const char * getData64bitsDirective() const
AsmCharLiteralSyntax characterLiteralSyntax() const
bool avoidWeakIfComdat() const
bool UseDotAlignForAlignment
True if .align is to be used for alignment.
const char * getByteListDirective() const
bool SetDirectiveSuppressesReloc
True if the expression .long f - g uses a relocation but it can be suppressed by writing a = f - g ....
bool hasVisibilityOnlyWithLinkage() const
const char * getCode16Directive() const
const char * Data32bitsDirective
bool UseIntegratedAssembler
Should we use the integrated assembler? The integrated assembler should be enabled by default (by the...
bool shouldUseMotorolaIntegers() const
bool supportsNameQuoting() const
bool AllowAtAtStartOfIdentifier
This is true if the assembler allows the "@" character at the start of a string to be lexed as an Asm...
const char * getGPRel64Directive() const
const char * Code16Directive
These are assembly directives that tells the assembler to interpret the following instructions differ...
bool UseLogicalShr
True if the integrated assembler should interpret 'a >> b' constant expressions as logical rather tha...
MCSymbolAttr getHiddenDeclarationVisibilityAttr() const
const char * GlobalDirective
This is the directive used to declare a global entity.
LCOMM::LCOMMType LCOMMDirectiveAlignmentType
Describes if the .lcomm directive for the target supports an alignment argument and how it is interpr...
bool hasWeakDefCanBeHiddenDirective() const
WinEH::EncodingType WinEHEncodingType
Windows exception handling data (.pdata) encoding. Defaults to Invalid.
bool HasCOFFComdatConstants
True if this is a non-GNU COFF target.
virtual void setPreserveAsmComments(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
bool hasLinkerPrivateGlobalPrefix() const
const char * WeakRefDirective
This directive, if non-null, is used to declare a global as being a weak undefined symbol.
StringRef PrivateLabelPrefix
This prefix is used for labels for basic blocks.
LCOMM::LCOMMType getLCOMMDirectiveAlignmentType() const
bool needsDwarfSectionOffsetDirective() const
bool shouldUseLogicalShr() const
bool HasDotTypeDotSizeDirective
True if the target has .type and .size directives, this is true for most ELF targets.
bool usesCFIForEH() const
Returns true if the exception handling method for the platform uses call frame information to unwind.
bool AllowAtInName
This is true if the assembler allows @ characters in symbol names.
bool EmitLabelsInUpperCase
Emit labels in purely upper case. Defaults to false.
unsigned CommentColumn
The column (zero-based) at which asm comments should be printed.
unsigned MaxInstLength
This is the maximum possible length of an instruction, which is needed to compute the size of an inli...
const char * TPRel32Directive
bool HasWeakDefCanBeHiddenDirective
True if we have a directive to declare a global as being a weak defined symbol that can be hidden (un...
StringRef getCommentString() const
const char * getAscizDirective() const
bool StarIsPC
Whether the '*' token refers to the current PC.
bool SunStyleELFSectionSwitchSyntax
This is true if this target uses "Sun Style" syntax for section switching ("#alloc,...
const char * InlineAsmStart
If these are nonempty, they contain a directive to emit before and after an inline assembly statement...
bool useParensForDollarSignNames() const
bool UseAssignmentForEHBegin
bool HasCOFFAssociativeComdats
True if this is a non-GNU COFF target.
bool doesSupportDebugInformation() const
bool doesSetDirectiveSuppressReloc() const
bool ParseInlineAsmUsingAsmParser
Use AsmParser to parse inlineAsm when UseIntegratedAssembler is not set.
WinEH::EncodingType getWinEHEncodingType() const
bool doesDwarfUseRelocationsAcrossSections() const
const char * getDTPRel64Directive() const
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
virtual void setParseInlineAsmUsingAsmParser(bool Value)
Set whether target want to use AsmParser to parse inlineasm.
const char * getZeroDirective() const
bool EnableDwarfFileDirectoryDefault
True if DWARF ‘.file directory’ directive syntax is used by default.
bool DwarfSectionSizeRequired
True if the target needs the DWARF section length in the header (if any) of the DWARF section in the ...
MCSymbolAttr getMemtagAttr() const
StringRef LinkerPrivateGlobalPrefix
This prefix is used for symbols that should be passed through the assembler but be removed by the lin...
bool SupportsDebugInformation
True if target supports emission of debugging information.
void setFullRegisterNames(bool V)
const char * getWeakDirective() const
virtual const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const
bool StackGrowsUp
True if target stack grow up. Default is false.
bool hasSubsectionsViaSymbols() const
bool PPCUseFullRegisterNames
True if full register names are printed.
const char * InlineAsmEnd
const char * getData16bitsDirective() const
const char * getSeparatorString() const
bool SupportsSignedData
True if data directives support signed values.
bool doesAllowAtAtStartOfIdentifier() const
bool getCOMMDirectiveAlignmentIsInBytes() const
bool isStackGrowthDirectionUp() const
True if target stack grow up.
virtual bool isAcceptableChar(char C) const
Return true if C is an acceptable character inside a symbol name.
unsigned AssemblerDialect
Which dialect of an assembler variant to use. Defaults to 0.
const char * SeparatorString
This string, if specified, is used to separate instructions from each other when on the same line.
virtual bool shouldOmitSectionDirective(StringRef SectionName) const
Return true if the .section directive should be omitted when emitting SectionName.
bool getEmitGNUAsmStartIndentationMarker() const
MCSymbolAttr HiddenDeclarationVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare an undefined symbol as having hidden visibili...
bool doesAllowHashAtStartOfIdentifier() const
bool hasPairedDoubleQuoteStringConstants() const
const char * GPRel32Directive
If non-null, a directive that is used to emit a word which should be relocated as a 32-bit GP-relativ...
bool shouldAllowAdditionalComments() const
unsigned getCalleeSaveStackSlotSize() const
Get the callee-saved register stack slot size in bytes.
bool UsesCFIWithoutEH
True if target uses CFI unwind information for other purposes than EH (debugging / sanitizers) when E...
bool HasIdentDirective
True if the target has a .ident directive, this is true for ELF targets.
bool UseParensForDollarSignNames
True if the target uses parens for symbol names starting with '$' character to distinguish them from ...
bool DwarfUsesRelocationsAcrossSections
True if Dwarf2 output generally uses relocations for references to other .debug_* sections.
bool needsDwarfSectionSizeInHeader() const
bool parseInlineAsmUsingAsmParser() const
Return true if target want to use AsmParser to parse inlineasm.
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
void setBinutilsVersion(std::pair< int, int > Value)
bool doDwarfFDESymbolsUseAbsDiff() const
const char * getGlobalDirective() const
const char * getCode32Directive() const
void setExceptionsType(ExceptionHandling EH)
bool doesAllowQuestionAtStartOfIdentifier() const
bool COMMDirectiveAlignmentIsInBytes
True is .comm's and .lcomms optional alignment is to be specified in bytes instead of log2(n).
bool getAlignmentIsInBytes() const
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
bool usesWindowsCFI() const
bool usesELFSectionDirectiveForBSS() const
AsmCharLiteralSyntax CharacterLiteralSyntax
Form used for character literals in the assembly syntax.
bool getDollarIsPC() const
bool SupportsExtendedDwarfLocDirective
True if the target supports flags in ".loc" directive, false if only location is allowed.
bool NeedsFunctionDescriptors
bool EmitGNUAsmStartIndentationMarker
Should we emit the '\t' as the starting indentation marker for GNU inline asm statements.
bool binutilsIsAtLeast(int Major, int Minor) const
bool ZeroDirectiveSupportsNonZeroValue
This should be set to true if the zero directive supports a value to emit other than zero.
const char * ZeroDirective
This should be set to the directive used to get some number of zero (and non-zero if supported by the...
unsigned getCommentColumn() const
MCSymbolAttr getHiddenVisibilityAttr() const
const char * getCode64Directive() const
bool SupportsQuotedNames
If this is true, symbol names with invalid characters will be printed in quotes.
bool hasSingleParameterDotFile() const
const char * AscizDirective
If not null, this allows for special handling of zero terminated strings on this target.
bool UseDataRegionDirectives
This is true if data region markers should be printed as ".data_region/.end_data_region" directives.
bool doesZeroDirectiveSupportNonZeroValue() const
bool DwarfRegNumForCFI
True if dwarf register numbers are printed instead of symbolic register names in ....
const char * getAsciiDirective() const
bool IsLittleEndian
True if target is little endian. Default is true.
AsmCharLiteralSyntax
Assembly character literal syntax types.
@ ACLS_SingleQuotePrefix
Unknown; character literals not used by LLVM for this target.
bool useDotAlignForAlignment() const
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
virtual const MCExpr * getExprForPersonalitySymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const
bool UseParensForSymbolVariant
True if target uses parens to indicate the symbol variant instead of .
std::pair< int, int > BinutilsVersion
bool HasLEB128Directives
True if the target supports LEB128 directives.
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
const char * getGPRel32Directive() const
const char * getWeakRefDirective() const
bool hasCOFFComdatConstants() const
MCSymbolAttr HiddenVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare a symbol as having hidden visibility.
virtual bool isValidUnquotedName(StringRef Name) const
Return true if the identifier Name does not need quotes to be syntactically correct.
const char * getDTPRel32Directive() const
bool hasNoDeadStrip() const
virtual MCSection * getNonexecutableStackSection(MCContext &Ctx) const
Targets can implement this method to specify a section to switch to if the translation unit doesn't h...
ExceptionHandling getExceptionHandlingType() const
StringRef CommentString
This indicates the comment string used by the assembler.
bool needsLocalForSize() const
bool AllowHashAtStartOfIdentifier
This is true if the assembler allows the "#" character at the start of a string to be lexed as an Asm...
const char * GPRel64Directive
If non-null, a directive that is used to emit a word which should be relocated as a 64-bit GP-relativ...
const char * WeakDirective
Used to declare a global as being a weak symbol. Defaults to ".weak".
void setCommentColumn(unsigned Col)
bool hasFunctionAlignment() const
bool enableDwarfFileDirectoryDefault() const
bool HasPairedDoubleQuoteStringConstants
True if the target represents string constants as mostly raw characters in paired double quotation wi...
bool usesDwarfFileAndLocDirectives() const
bool hasIdentDirective() const
unsigned getCodePointerSize() const
Get the code pointer size in bytes.
Context object for machine code objects.
Base class for the full range of assembler expressions which are needed for parsing.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Streaming machine code generation interface.
Generic base class for all target subtargets.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
LLVM Value Representation.
@ C
The default llvm calling convention, compatible with C.
@ MIPS
Windows x86, uses no CFI, just EH tables.
@ Itanium
Windows CE ARM, PowerPC, SH3, SH4.
@ CE
Windows NT (Windows on ARM)
@ X86
Windows x64, Windows Itanium (IA-64)
This is an optimization pass for GlobalISel generic memory operations.
@ ZOS
z/OS MVS Exception Handling.
@ None
No exception support.
@ DwarfCFI
DWARF-like instruction based exceptions.
@ WinEH
Windows Exception Handling.
@ MCSA_Memtag
.memtag (ELF)
@ MCSA_Protected
.protected (ELF)
@ MCSA_Exported
.globl _foo, exported (XCOFF)
@ MCSA_Hidden
.hidden (ELF)