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