LLVM  4.0.0
MCAsmInfo.h
Go to the documentation of this file.
1 //===-- llvm/MC/MCAsmInfo.h - Asm info --------------------------*- C++ -*-===//
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 a class to be used as the basis for target specific
11 // asm writers. This class primarily takes care of global printing constants,
12 // which are used in very similar ways across all targets.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_MC_MCASMINFO_H
17 #define LLVM_MC_MCASMINFO_H
18 
19 #include "llvm/MC/MCDirectives.h"
20 #include "llvm/MC/MCDwarf.h"
22 #include <cassert>
23 #include <vector>
24 
25 namespace llvm {
26 class MCExpr;
27 class MCSection;
28 class MCStreamer;
29 class MCSymbol;
30 class MCContext;
31 
32 namespace WinEH {
33 enum class EncodingType {
34  Invalid, /// Invalid
35  Alpha, /// Windows Alpha
36  Alpha64, /// Windows AXP64
37  ARM, /// Windows NT (Windows on ARM)
38  CE, /// Windows CE ARM, PowerPC, SH3, SH4
39  Itanium, /// Windows x64, Windows Itanium (IA-64)
40  X86, /// Windows x86, uses no CFI, just EH tables
41  MIPS = Alpha,
42 };
43 }
44 
45 namespace LCOMM {
47 }
48 
50  DCT_None, // no compression
51  DCT_Zlib, // zlib style complession
52  DCT_ZlibGnu // zlib-gnu style compression
53 };
54 
55 /// This class is intended to be used as a base class for asm
56 /// properties and features specific to the target.
57 class MCAsmInfo {
58 protected:
59  //===------------------------------------------------------------------===//
60  // Properties to be set by the target writer, used to configure asm printer.
61  //
62 
63  /// Pointer size in bytes. Default is 4.
64  unsigned PointerSize;
65 
66  /// Size of the stack slot reserved for callee-saved registers, in bytes.
67  /// Default is same as pointer size.
69 
70  /// True if target is little endian. Default is true.
72 
73  /// True if target stack grow up. Default is false.
75 
76  /// True if this target has the MachO .subsections_via_symbols directive.
77  /// Default is false.
79 
80  /// True if this is a MachO target that supports the macho-specific .zerofill
81  /// directive for emitting BSS Symbols. Default is false.
83 
84  /// True if this is a MachO target that supports the macho-specific .tbss
85  /// directive for emitting thread local BSS Symbols. Default is false.
87 
88  /// This is the maximum possible length of an instruction, which is needed to
89  /// compute the size of an inline asm. Defaults to 4.
90  unsigned MaxInstLength;
91 
92  /// Every possible instruction length is a multiple of this value. Factored
93  /// out in .debug_frame and .debug_line. Defaults to 1.
94  unsigned MinInstAlignment;
95 
96  /// The '$' token, when not referencing an identifier or constant, refers to
97  /// the current PC. Defaults to false.
98  bool DollarIsPC;
99 
100  /// This string, if specified, is used to separate instructions from each
101  /// other when on the same line. Defaults to ';'
102  const char *SeparatorString;
103 
104  /// This indicates the comment character used by the assembler. Defaults to
105  /// "#"
107 
108  /// This is appended to emitted labels. Defaults to ":"
109  const char *LabelSuffix;
110 
111  // Print the EH begin symbol with an assignment. Defaults to false.
113 
114  // Do we need to create a local symbol for .size?
116 
117  /// This prefix is used for globals like constant pool entries that are
118  /// completely private to the .s file and should not have names in the .o
119  /// file. Defaults to "L"
121 
122  /// This prefix is used for labels for basic blocks. Defaults to the same as
123  /// PrivateGlobalPrefix.
125 
126  /// This prefix is used for symbols that should be passed through the
127  /// assembler but be removed by the linker. This is 'l' on Darwin, currently
128  /// used for some ObjC metadata. The default of "" meast that for this system
129  /// a plain private symbol should be used. Defaults to "".
131 
132  /// If these are nonempty, they contain a directive to emit before and after
133  /// an inline assembly statement. Defaults to "#APP\n", "#NO_APP\n"
134  const char *InlineAsmStart;
135  const char *InlineAsmEnd;
136 
137  /// These are assembly directives that tells the assembler to interpret the
138  /// following instructions differently. Defaults to ".code16", ".code32",
139  /// ".code64".
140  const char *Code16Directive;
141  const char *Code32Directive;
142  const char *Code64Directive;
143 
144  /// Which dialect of an assembler variant to use. Defaults to 0
146 
147  /// This is true if the assembler allows @ characters in symbol names.
148  /// Defaults to false.
150 
151  /// If this is true, symbol names with invalid characters will be printed in
152  /// quotes.
154 
155  /// This is true if data region markers should be printed as
156  /// ".data_region/.end_data_region" directives. If false, use "$d/$a" labels
157  /// instead.
159 
160  //===--- Data Emission Directives -------------------------------------===//
161 
162  /// This should be set to the directive used to get some number of zero bytes
163  /// emitted to the current section. Common cases are "\t.zero\t" and
164  /// "\t.space\t". If this is set to null, the Data*bitsDirective's will be
165  /// used to emit zero bytes. Defaults to "\t.zero\t"
166  const char *ZeroDirective;
167 
168  /// This directive allows emission of an ascii string with the standard C
169  /// escape characters embedded into it. Defaults to "\t.ascii\t"
170  const char *AsciiDirective;
171 
172  /// If not null, this allows for special handling of zero terminated strings
173  /// on this target. This is commonly supported as ".asciz". If a target
174  /// doesn't support this, it can be set to null. Defaults to "\t.asciz\t"
175  const char *AscizDirective;
176 
177  /// These directives are used to output some unit of integer data to the
178  /// current section. If a data directive is set to null, smaller data
179  /// directives will be used to emit the large sizes. Defaults to "\t.byte\t",
180  /// "\t.short\t", "\t.long\t", "\t.quad\t"
181  const char *Data8bitsDirective;
182  const char *Data16bitsDirective;
183  const char *Data32bitsDirective;
184  const char *Data64bitsDirective;
185 
186  /// If non-null, a directive that is used to emit a word which should be
187  /// relocated as a 64-bit GP-relative offset, e.g. .gpdword on Mips. Defaults
188  /// to NULL.
189  const char *GPRel64Directive;
190 
191  /// If non-null, a directive that is used to emit a word which should be
192  /// relocated as a 32-bit GP-relative offset, e.g. .gpword on Mips or .gprel32
193  /// on Alpha. Defaults to NULL.
194  const char *GPRel32Directive;
195 
196  /// If non-null, directives that are used to emit a word/dword which should
197  /// be relocated as a 32/64-bit DTP/TP-relative offset, e.g. .dtprelword/
198  /// .dtpreldword/.tprelword/.tpreldword on Mips.
199  const char *DTPRel32Directive = nullptr;
200  const char *DTPRel64Directive = nullptr;
201  const char *TPRel32Directive = nullptr;
202  const char *TPRel64Directive = nullptr;
203 
204  /// This is true if this target uses "Sun Style" syntax for section switching
205  /// ("#alloc,#write" etc) instead of the normal ELF syntax (,"a,w") in
206  /// .section directives. Defaults to false.
208 
209  /// This is true if this target uses ELF '.section' directive before the
210  /// '.bss' one. It's used for PPC/Linux which doesn't support the '.bss'
211  /// directive only. Defaults to false.
213 
215 
216  //===--- Alignment Information ----------------------------------------===//
217 
218  /// If this is true (the default) then the asmprinter emits ".align N"
219  /// directives, where N is the number of bytes to align to. Otherwise, it
220  /// emits ".align log2(N)", e.g. 3 to align to an 8 byte boundary. Defaults
221  /// to true.
223 
224  /// If non-zero, this is used to fill the executable space created as the
225  /// result of a alignment directive. Defaults to 0
227 
228  //===--- Global Variable Emission Directives --------------------------===//
229 
230  /// This is the directive used to declare a global entity. Defaults to
231  /// ".globl".
232  const char *GlobalDirective;
233 
234  /// True if the expression
235  /// .long f - g
236  /// uses a relocation but it can be suppressed by writing
237  /// a = f - g
238  /// .long a
240 
241  /// False if the assembler requires that we use
242  /// \code
243  /// Lc = a - b
244  /// .long Lc
245  /// \endcode
246  //
247  /// instead of
248  //
249  /// \code
250  /// .long a - b
251  /// \endcode
252  ///
253  /// Defaults to true.
255 
256  /// True is .comm's and .lcomms optional alignment is to be specified in bytes
257  /// instead of log2(n). Defaults to true.
259 
260  /// Describes if the .lcomm directive for the target supports an alignment
261  /// argument and how it is interpreted. Defaults to NoAlignment.
263 
264  // True if the target allows .align directives on functions. This is true for
265  // most targets, so defaults to true.
267 
268  /// True if the target has .type and .size directives, this is true for most
269  /// ELF targets. Defaults to true.
271 
272  /// True if the target has a single parameter .file directive, this is true
273  /// for ELF targets. Defaults to true.
275 
276  /// True if the target has a .ident directive, this is true for ELF targets.
277  /// Defaults to false.
279 
280  /// True if this target supports the MachO .no_dead_strip directive. Defaults
281  /// to false.
283 
284  /// True if this target supports the MachO .alt_entry directive. Defaults to
285  /// false.
287 
288  /// Used to declare a global as being a weak symbol. Defaults to ".weak".
289  const char *WeakDirective;
290 
291  /// This directive, if non-null, is used to declare a global as being a weak
292  /// undefined symbol. Defaults to NULL.
293  const char *WeakRefDirective;
294 
295  /// True if we have a directive to declare a global as being a weak defined
296  /// symbol. Defaults to false.
298 
299  /// True if we have a directive to declare a global as being a weak defined
300  /// symbol that can be hidden (unexported). Defaults to false.
302 
303  /// True if we have a .linkonce directive. This is used on cygwin/mingw.
304  /// Defaults to false.
306 
307  /// This attribute, if not MCSA_Invalid, is used to declare a symbol as having
308  /// hidden visibility. Defaults to MCSA_Hidden.
310 
311  /// This attribute, if not MCSA_Invalid, is used to declare an undefined
312  /// symbol as having hidden visibility. Defaults to MCSA_Hidden.
314 
315  /// This attribute, if not MCSA_Invalid, is used to declare a symbol as having
316  /// protected visibility. Defaults to MCSA_Protected
318 
319  //===--- Dwarf Emission Directives -----------------------------------===//
320 
321  /// True if target supports emission of debugging information. Defaults to
322  /// false.
324 
325  /// Exception handling format for the target. Defaults to None.
327 
328  /// Windows exception handling data (.pdata) encoding. Defaults to Invalid.
330 
331  /// True if Dwarf2 output generally uses relocations for references to other
332  /// .debug_* sections.
334 
335  /// True if DWARF FDE symbol reference relocations should be replaced by an
336  /// absolute difference.
338 
339  /// True if dwarf register numbers are printed instead of symbolic register
340  /// names in .cfi_* directives. Defaults to false.
342 
343  /// True if target uses parens to indicate the symbol variant instead of @.
344  /// For example, foo(plt) instead of foo@plt. Defaults to false.
346 
347  //===--- Prologue State ----------------------------------------------===//
348 
349  std::vector<MCCFIInstruction> InitialFrameState;
350 
351  //===--- Integrated Assembler Information ----------------------------===//
352 
353  /// Should we use the integrated assembler?
354  /// The integrated assembler should be enabled by default (by the
355  /// constructors) when failing to parse a valid piece of assembly (inline
356  /// or otherwise) is considered a bug. It may then be overridden after
357  /// construction (see LLVMTargetMachine::initAsmInfo()).
359 
360  /// Preserve Comments in assembly
362 
363  /// Compress DWARF debug sections. Defaults to no compression.
365 
366  /// True if the integrated assembler should interpret 'a >> b' constant
367  /// expressions as logical rather than arithmetic.
369 
370  // If true, emit GOTPCRELX/REX_GOTPCRELX instead of GOTPCREL, on
371  // X86_64 ELF.
372  bool RelaxELFRelocations = true;
373 
374  // If true, then the lexer and expression parser will support %neg(),
375  // %hi(), and similar unary operators.
376  bool HasMipsExpressions = false;
377 
378 public:
379  explicit MCAsmInfo();
380  virtual ~MCAsmInfo();
381 
382  /// Get the pointer size in bytes.
383  unsigned getPointerSize() const { return PointerSize; }
384 
385  /// Get the callee-saved register stack slot
386  /// size in bytes.
387  unsigned getCalleeSaveStackSlotSize() const {
389  }
390 
391  /// True if the target is little endian.
392  bool isLittleEndian() const { return IsLittleEndian; }
393 
394  /// True if target stack grow up.
395  bool isStackGrowthDirectionUp() const { return StackGrowsUp; }
396 
398 
399  // Data directive accessors.
400 
401  const char *getData8bitsDirective() const { return Data8bitsDirective; }
402  const char *getData16bitsDirective() const { return Data16bitsDirective; }
403  const char *getData32bitsDirective() const { return Data32bitsDirective; }
404  const char *getData64bitsDirective() const { return Data64bitsDirective; }
405  const char *getGPRel64Directive() const { return GPRel64Directive; }
406  const char *getGPRel32Directive() const { return GPRel32Directive; }
407  const char *getDTPRel64Directive() const { return DTPRel64Directive; }
408  const char *getDTPRel32Directive() const { return DTPRel32Directive; }
409  const char *getTPRel64Directive() const { return TPRel64Directive; }
410  const char *getTPRel32Directive() const { return TPRel32Directive; }
411 
412  /// Targets can implement this method to specify a section to switch to if the
413  /// translation unit doesn't have any trampolines that require an executable
414  /// stack.
416  return nullptr;
417  }
418 
419  /// \brief True if the section is atomized using the symbols in it.
420  /// This is false if the section is not atomized at all (most ELF sections) or
421  /// if it is atomized based on its contents (MachO' __TEXT,__cstring for
422  /// example).
423  virtual bool isSectionAtomizableBySymbols(const MCSection &Section) const;
424 
425  virtual const MCExpr *getExprForPersonalitySymbol(const MCSymbol *Sym,
426  unsigned Encoding,
427  MCStreamer &Streamer) const;
428 
429  virtual const MCExpr *getExprForFDESymbol(const MCSymbol *Sym,
430  unsigned Encoding,
431  MCStreamer &Streamer) const;
432 
433  /// Return true if the identifier \p Name does not need quotes to be
434  /// syntactically correct.
435  virtual bool isValidUnquotedName(StringRef Name) const;
436 
437  /// Return true if the .section directive should be omitted when
438  /// emitting \p SectionName. For example:
439  ///
440  /// shouldOmitSectionDirective(".text")
441  ///
442  /// returns false => .section .text,#alloc,#execinstr
443  /// returns true => .text
445 
448  }
449 
452  }
453 
456  }
457 
458  // Accessors.
459 
462  unsigned getMaxInstLength() const { return MaxInstLength; }
463  unsigned getMinInstAlignment() const { return MinInstAlignment; }
464  bool getDollarIsPC() const { return DollarIsPC; }
465  const char *getSeparatorString() const { return SeparatorString; }
466 
467  /// This indicates the column (zero-based) at which asm comments should be
468  /// printed.
469  unsigned getCommentColumn() const { return 40; }
470 
472  const char *getLabelSuffix() const { return LabelSuffix; }
473 
475  bool needsLocalForSize() const { return NeedsLocalForSize; }
479  return LinkerPrivateGlobalPrefix[0] != '\0';
480  }
484  return getPrivateGlobalPrefix();
485  }
486  const char *getInlineAsmStart() const { return InlineAsmStart; }
487  const char *getInlineAsmEnd() const { return InlineAsmEnd; }
488  const char *getCode16Directive() const { return Code16Directive; }
489  const char *getCode32Directive() const { return Code32Directive; }
490  const char *getCode64Directive() const { return Code64Directive; }
491  unsigned getAssemblerDialect() const { return AssemblerDialect; }
492  bool doesAllowAtInName() const { return AllowAtInName; }
493  bool supportsNameQuoting() const { return SupportsQuotedNames; }
496  }
497  const char *getZeroDirective() const { return ZeroDirective; }
498  const char *getAsciiDirective() const { return AsciiDirective; }
499  const char *getAscizDirective() const { return AscizDirective; }
500  bool getAlignmentIsInBytes() const { return AlignmentIsInBytes; }
501  unsigned getTextAlignFillValue() const { return TextAlignFillValue; }
502  const char *getGlobalDirective() const { return GlobalDirective; }
505  }
509  }
512  }
516  bool hasIdentDirective() const { return HasIdentDirective; }
517  bool hasNoDeadStrip() const { return HasNoDeadStrip; }
518  bool hasAltEntry() const { return HasAltEntry; }
519  const char *getWeakDirective() const { return WeakDirective; }
520  const char *getWeakRefDirective() const { return WeakRefDirective; }
521  bool hasWeakDefDirective() const { return HasWeakDefDirective; }
524  }
526 
530  }
533  }
537  }
540 
542  ExceptionsType = EH;
543  }
544 
545  /// Returns true if the exception handling method for the platform uses call
546  /// frame information to unwind.
547  bool usesCFIForEH() const {
550  }
551 
552  bool usesWindowsCFI() const {
556  }
557 
560  }
562  bool useDwarfRegNumForCFI() const { return DwarfRegNumForCFI; }
564 
566  InitialFrameState.push_back(Inst);
567  }
568 
569  const std::vector<MCCFIInstruction> &getInitialFrameState() const {
570  return InitialFrameState;
571  }
572 
573  /// Return true if assembly (inline or otherwise) should be parsed.
575 
576  /// Set whether assembly (inline or otherwise) should be parsed.
577  virtual void setUseIntegratedAssembler(bool Value) {
578  UseIntegratedAssembler = Value;
579  }
580 
581  /// Return true if assembly (inline or otherwise) should be parsed.
582  bool preserveAsmComments() const { return PreserveAsmComments; }
583 
584  /// Set whether assembly (inline or otherwise) should be parsed.
585  virtual void setPreserveAsmComments(bool Value) {
586  PreserveAsmComments = Value;
587  }
588 
590  return CompressDebugSections;
591  }
592 
594  this->CompressDebugSections = CompressDebugSections;
595  }
596 
597  bool shouldUseLogicalShr() const { return UseLogicalShr; }
598 
599  bool canRelaxRelocations() const { return RelaxELFRelocations; }
601  bool hasMipsExpressions() const { return HasMipsExpressions; }
602 };
603 }
604 
605 #endif
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition: MCAsmInfo.h:274
const char * Code16Directive
These are assembly directives that tells the assembler to interpret the following instructions differ...
Definition: MCAsmInfo.h:140
virtual bool isValidUnquotedName(StringRef Name) const
Return true if the identifier Name does not need quotes to be syntactically correct.
Definition: MCAsmInfo.cpp:148
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:40
LCOMM::LCOMMType LCOMMDirectiveAlignmentType
Describes if the .lcomm directive for the target supports an alignment argument and how it is interpr...
Definition: MCAsmInfo.h:262
bool doesSupportDebugInformation() const
Definition: MCAsmInfo.h:534
unsigned getAssemblerDialect() const
Definition: MCAsmInfo.h:491
bool useAssignmentForEHBegin() const
Definition: MCAsmInfo.h:474
bool canRelaxRelocations() const
Definition: MCAsmInfo.h:599
unsigned TextAlignFillValue
If non-zero, this is used to fill the executable space created as the result of a alignment directive...
Definition: MCAsmInfo.h:226
bool useDwarfRegNumForCFI() const
Definition: MCAsmInfo.h:562
const char * getData8bitsDirective() const
Definition: MCAsmInfo.h:401
bool HasSubsectionsViaSymbols
True if this target has the MachO .subsections_via_symbols directive.
Definition: MCAsmInfo.h:78
bool UseIntegratedAssembler
Should we use the integrated assembler? The integrated assembler should be enabled by default (by the...
Definition: MCAsmInfo.h:358
bool hasIdentDirective() const
Definition: MCAsmInfo.h:516
bool doesAllowAtInName() const
Definition: MCAsmInfo.h:492
StringRef PrivateLabelPrefix
This prefix is used for labels for basic blocks.
Definition: MCAsmInfo.h:124
bool needsLocalForSize() const
Definition: MCAsmInfo.h:475
const char * WeakDirective
Used to declare a global as being a weak symbol. Defaults to ".weak".
Definition: MCAsmInfo.h:289
bool DwarfRegNumForCFI
True if dwarf register numbers are printed instead of symbolic register names in .cfi_* directives.
Definition: MCAsmInfo.h:341
void setCompressDebugSections(DebugCompressionType CompressDebugSections)
Definition: MCAsmInfo.h:593
unsigned getTextAlignFillValue() const
Definition: MCAsmInfo.h:501
WinEH::EncodingType getWinEHEncodingType() const
Definition: MCAsmInfo.h:539
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
virtual void setUseIntegratedAssembler(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
Definition: MCAsmInfo.h:577
bool DwarfUsesRelocationsAcrossSections
True if Dwarf2 output generally uses relocations for references to other .debug_* sections...
Definition: MCAsmInfo.h:333
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
bool SupportsQuotedNames
If this is true, symbol names with invalid characters will be printed in quotes.
Definition: MCAsmInfo.h:153
bool IsLittleEndian
True if target is little endian. Default is true.
Definition: MCAsmInfo.h:71
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
unsigned AssemblerDialect
Which dialect of an assembler variant to use. Defaults to 0.
Definition: MCAsmInfo.h:145
bool HasWeakDefCanBeHiddenDirective
True if we have a directive to declare a global as being a weak defined symbol that can be hidden (un...
Definition: MCAsmInfo.h:301
virtual bool isSectionAtomizableBySymbols(const MCSection &Section) const
True if the section is atomized using the symbols in it.
Definition: MCAsmInfo.cpp:117
setjmp/longjmp based exceptions
const char * getWeakRefDirective() const
Definition: MCAsmInfo.h:520
LCOMM::LCOMMType getLCOMMDirectiveAlignmentType() const
Definition: MCAsmInfo.h:510
bool hasLinkOnceDirective() const
Definition: MCAsmInfo.h:525
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
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
Definition: MCAsmInfo.h:222
const char * SeparatorString
This string, if specified, is used to separate instructions from each other when on the same line...
Definition: MCAsmInfo.h:102
bool hasMachoTBSSDirective() const
Definition: MCAsmInfo.h:461
DebugCompressionType compressDebugSections() const
Definition: MCAsmInfo.h:589
StringRef getCommentString() const
Definition: MCAsmInfo.h:471
bool HasNoDeadStrip
True if this target supports the MachO .no_dead_strip directive.
Definition: MCAsmInfo.h:282
MCSymbolAttr getHiddenVisibilityAttr() const
Definition: MCAsmInfo.h:527
virtual const MCExpr * getExprForPersonalitySymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const
Definition: MCAsmInfo.cpp:122
bool hasLinkerPrivateGlobalPrefix() const
Definition: MCAsmInfo.h:478
bool hasWeakDefDirective() const
Definition: MCAsmInfo.h:521
bool UseLogicalShr
True if the integrated assembler should interpret 'a >> b' constant expressions as logical rather t...
Definition: MCAsmInfo.h:368
StringRef CommentString
This indicates the comment character used by the assembler.
Definition: MCAsmInfo.h:106
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition: MCAsmInfo.h:212
const char * Data8bitsDirective
These directives are used to output some unit of integer data to the current section.
Definition: MCAsmInfo.h:181
bool HasAggressiveSymbolFolding
False if the assembler requires that we use.
Definition: MCAsmInfo.h:254
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:34
unsigned getCommentColumn() const
This indicates the column (zero-based) at which asm comments should be printed.
Definition: MCAsmInfo.h:469
const char * getTPRel64Directive() const
Definition: MCAsmInfo.h:409
const std::vector< MCCFIInstruction > & getInitialFrameState() const
Definition: MCAsmInfo.h:569
Windows x86, uses no CFI, just EH tables.
bool hasMachoZeroFillDirective() const
Definition: MCAsmInfo.h:460
bool StackGrowsUp
True if target stack grow up. Default is false.
Definition: MCAsmInfo.h:74
StringRef getPrivateGlobalPrefix() const
Definition: MCAsmInfo.h:476
Windows NT (Windows on ARM)
bool hasAltEntry() const
Definition: MCAsmInfo.h:518
const char * getInlineAsmEnd() const
Definition: MCAsmInfo.h:487
bool isLittleEndian() const
True if the target is little endian.
Definition: MCAsmInfo.h:392
Context object for machine code objects.
Definition: MCContext.h:51
bool SunStyleELFSectionSwitchSyntax
This is true if this target uses "Sun Style" syntax for section switching ("#alloc,#write" etc) instead of the normal ELF syntax (,"a,w") in .section directives.
Definition: MCAsmInfo.h:207
const char * getLabelSuffix() const
Definition: MCAsmInfo.h:472
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
const char * getCode16Directive() const
Definition: MCAsmInfo.h:488
const char * getDTPRel64Directive() const
Definition: MCAsmInfo.h:407
void addInitialFrameState(const MCCFIInstruction &Inst)
Definition: MCAsmInfo.h:565
const char * getCode32Directive() const
Definition: MCAsmInfo.h:489
const char * Code32Directive
Definition: MCAsmInfo.h:141
bool HasLinkOnceDirective
True if we have a .linkonce directive.
Definition: MCAsmInfo.h:305
const char * AscizDirective
If not null, this allows for special handling of zero terminated strings on this target.
Definition: MCAsmInfo.h:175
virtual bool shouldOmitSectionDirective(StringRef SectionName) const
Return true if the .section directive should be omitted when emitting SectionName.
Definition: MCAsmInfo.cpp:162
bool doesSupportExceptionHandling() const
Definition: MCAsmInfo.h:535
bool DollarIsPC
The '$' token, when not referencing an identifier or constant, refers to the current PC...
Definition: MCAsmInfo.h:98
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:57
const char * InlineAsmStart
If these are nonempty, they contain a directive to emit before and after an inline assembly statement...
Definition: MCAsmInfo.h:134
bool HasMipsExpressions
Definition: MCAsmInfo.h:376
bool needsDwarfSectionOffsetDirective() const
Definition: MCAsmInfo.h:454
bool HasIdentDirective
True if the target has a .ident directive, this is true for ELF targets.
Definition: MCAsmInfo.h:278
Streaming machine code generation interface.
Definition: MCStreamer.h:161
virtual void setPreserveAsmComments(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
Definition: MCAsmInfo.h:585
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...
Definition: MCAsmInfo.h:189
MCSymbolAttr getHiddenDeclarationVisibilityAttr() const
Definition: MCAsmInfo.h:528
const char * getAsciiDirective() const
Definition: MCAsmInfo.h:498
MCSymbolAttr getProtectedVisibilityAttr() const
Definition: MCAsmInfo.h:531
const char * TPRel32Directive
Definition: MCAsmInfo.h:201
bool COMMDirectiveAlignmentIsInBytes
True is .comm's and .lcomms optional alignment is to be specified in bytes instead of log2(n)...
Definition: MCAsmInfo.h:258
unsigned PointerSize
Pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:64
bool AllowAtInName
This is true if the assembler allows @ characters in symbol names.
Definition: MCAsmInfo.h:149
bool shouldUseLogicalShr() const
Definition: MCAsmInfo.h:597
bool hasFunctionAlignment() const
Definition: MCAsmInfo.h:513
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:323
bool usesSunStyleELFSectionSwitchSyntax() const
Definition: MCAsmInfo.h:446
const char * getData16bitsDirective() const
Definition: MCAsmInfo.h:402
const char * getData32bitsDirective() const
Definition: MCAsmInfo.h:403
bool preserveAsmComments() const
Return true if assembly (inline or otherwise) should be parsed.
Definition: MCAsmInfo.h:582
WinEH::EncodingType WinEHEncodingType
Windows exception handling data (.pdata) encoding. Defaults to Invalid.
Definition: MCAsmInfo.h:329
const char * WeakRefDirective
This directive, if non-null, is used to declare a global as being a weak undefined symbol...
Definition: MCAsmInfo.h:293
ExceptionHandling getExceptionHandlingType() const
Definition: MCAsmInfo.h:538
const char * getWeakDirective() const
Definition: MCAsmInfo.h:519
DebugCompressionType CompressDebugSections
Compress DWARF debug sections. Defaults to no compression.
Definition: MCAsmInfo.h:364
const char * Data16bitsDirective
Definition: MCAsmInfo.h:182
bool UseAssignmentForEHBegin
Definition: MCAsmInfo.h:112
const char * getData64bitsDirective() const
Definition: MCAsmInfo.h:404
void setRelaxELFRelocations(bool V)
Definition: MCAsmInfo.h:600
const char * DTPRel64Directive
Definition: MCAsmInfo.h:200
const char * getCode64Directive() const
Definition: MCAsmInfo.h:490
Windows x64, Windows Itanium (IA-64)
unsigned getPointerSize() const
Get the pointer size in bytes.
Definition: MCAsmInfo.h:383
StringRef getPrivateLabelPrefix() const
Definition: MCAsmInfo.h:477
bool HasWeakDefDirective
True if we have a directive to declare a global as being a weak defined symbol.
Definition: MCAsmInfo.h:297
bool usesELFSectionDirectiveForBSS() const
Definition: MCAsmInfo.h:450
bool hasMipsExpressions() const
Definition: MCAsmInfo.h:601
bool doesSetDirectiveSuppressReloc() const
Definition: MCAsmInfo.h:503
unsigned getMinInstAlignment() const
Definition: MCAsmInfo.h:463
bool doDwarfFDESymbolsUseAbsDiff() const
Definition: MCAsmInfo.h:561
bool NeedsLocalForSize
Definition: MCAsmInfo.h:115
bool doesSupportDataRegionDirectives() const
Definition: MCAsmInfo.h:494
bool HasAltEntry
True if this target supports the MachO .alt_entry directive.
Definition: MCAsmInfo.h:286
const char * LabelSuffix
This is appended to emitted labels. Defaults to ":".
Definition: MCAsmInfo.h:109
bool HasMachoZeroFillDirective
True if this is a MachO target that supports the macho-specific .zerofill directive for emitting BSS ...
Definition: MCAsmInfo.h:82
const char * TPRel64Directive
Definition: MCAsmInfo.h:202
bool getDollarIsPC() const
Definition: MCAsmInfo.h:464
std::vector< MCCFIInstruction > InitialFrameState
Definition: MCAsmInfo.h:349
virtual ~MCAsmInfo()
Definition: MCAsmInfo.cpp:114
const char * InlineAsmEnd
Definition: MCAsmInfo.h:135
bool DwarfFDESymbolsUseAbsDiff
True if DWARF FDE symbol reference relocations should be replaced by an absolute difference.
Definition: MCAsmInfo.h:337
bool HasMachoTBSSDirective
True if this is a MachO target that supports the macho-specific .tbss directive for emitting thread l...
Definition: MCAsmInfo.h:86
const char * getGPRel64Directive() const
Definition: MCAsmInfo.h:405
MCSymbolAttr
Definition: MCDirectives.h:19
unsigned MinInstAlignment
Every possible instruction length is a multiple of this value.
Definition: MCAsmInfo.h:94
const char * getGPRel32Directive() const
Definition: MCAsmInfo.h:406
const char * Data32bitsDirective
Definition: MCAsmInfo.h:183
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...
Definition: MCAsmInfo.h:194
bool hasSingleParameterDotFile() const
Definition: MCAsmInfo.h:515
bool getCOMMDirectiveAlignmentIsInBytes() const
Definition: MCAsmInfo.h:507
bool getAlignmentIsInBytes() const
Definition: MCAsmInfo.h:500
bool PreserveAsmComments
Preserve Comments in assembly.
Definition: MCAsmInfo.h:361
MCSymbolAttr ProtectedVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare a symbol as having protected visibility...
Definition: MCAsmInfo.h:317
bool hasNoDeadStrip() const
Definition: MCAsmInfo.h:517
bool SetDirectiveSuppressesReloc
True if the expression .long f - g uses a relocation but it can be suppressed by writing a = f - g ...
Definition: MCAsmInfo.h:239
bool isStackGrowthDirectionUp() const
True if target stack grow up.
Definition: MCAsmInfo.h:395
bool supportsNameQuoting() const
Definition: MCAsmInfo.h:493
const char * getSeparatorString() const
Definition: MCAsmInfo.h:465
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:326
StringRef LinkerPrivateGlobalPrefix
This prefix is used for symbols that should be passed through the assembler but be removed by the lin...
Definition: MCAsmInfo.h:130
unsigned getCalleeSaveStackSlotSize() const
Get the callee-saved register stack slot size in bytes.
Definition: MCAsmInfo.h:387
bool UseDataRegionDirectives
This is true if data region markers should be printed as ".data_region/.end_data_region" directives...
Definition: MCAsmInfo.h:158
const char SectionName[]
Definition: AMDGPUPTNote.h:24
bool hasAggressiveSymbolFolding() const
Definition: MCAsmInfo.h:506
bool NeedsDwarfSectionOffsetDirective
Definition: MCAsmInfo.h:214
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...
Definition: MCAsmInfo.h:415
MCSymbolAttr HiddenDeclarationVisibilityAttr
This attribute, if not MCSA_Invalid, is used to declare an undefined symbol as having hidden visibili...
Definition: MCAsmInfo.h:313
virtual const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const
Definition: MCAsmInfo.cpp:129
const char * getDTPRel32Directive() const
Definition: MCAsmInfo.h:408
LLVM Value Representation.
Definition: Value.h:71
unsigned getMaxInstLength() const
Definition: MCAsmInfo.h:462
bool useParensForSymbolVariant() const
Definition: MCAsmInfo.h:563
StringRef getLinkerPrivateGlobalPrefix() const
Definition: MCAsmInfo.h:481
bool hasSubsectionsViaSymbols() const
Definition: MCAsmInfo.h:397
ExceptionHandling
Windows CE ARM, PowerPC, SH3, SH4.
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...
Definition: MCAsmInfo.h:199
bool useIntegratedAssembler() const
Return true if assembly (inline or otherwise) should be parsed.
Definition: MCAsmInfo.h:574
const char * getZeroDirective() const
Definition: MCAsmInfo.h:497
const char * getAscizDirective() const
Definition: MCAsmInfo.h:499
bool hasWeakDefCanBeHiddenDirective() const
Definition: MCAsmInfo.h:522
const char * getGlobalDirective() const
Definition: MCAsmInfo.h:502
void setExceptionsType(ExceptionHandling EH)
Definition: MCAsmInfo.h:541
bool usesCFIForEH() const
Returns true if the exception handling method for the platform uses call frame information to unwind...
Definition: MCAsmInfo.h:547
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
No exception support.
const char * getInlineAsmStart() const
Definition: MCAsmInfo.h:486
bool RelaxELFRelocations
Definition: MCAsmInfo.h:372
bool hasDotTypeDotSizeDirective() const
Definition: MCAsmInfo.h:514
StringRef PrivateGlobalPrefix
This prefix is used for globals like constant pool entries that are completely private to the ...
Definition: MCAsmInfo.h:120
const char * getTPRel32Directive() const
Definition: MCAsmInfo.h:410
bool doesDwarfUseRelocationsAcrossSections() const
Definition: MCAsmInfo.h:558
const char * Code64Directive
Definition: MCAsmInfo.h:142
unsigned MaxInstLength
This is the maximum possible length of an instruction, which is needed to compute the size of an inli...
Definition: MCAsmInfo.h:90
DebugCompressionType
Definition: MCAsmInfo.h:49
bool UseParensForSymbolVariant
True if target uses parens to indicate the symbol variant instead of
Definition: MCAsmInfo.h:345
bool usesWindowsCFI() const
Definition: MCAsmInfo.h:552