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