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