1 //===-- llvm/Target/TargetAsmInfo.h - Asm info ------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
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.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_TARGET_ASM_INFO_H
17 #define LLVM_TARGET_ASM_INFO_H
19 #include "llvm/ADT/DenseMap.h"
20 #include "llvm/ADT/StringMap.h"
21 #include "llvm/Support/DataTypes.h"
25 // DWARF encoding query type
26 namespace DwarfEncoding {
34 namespace SectionKind {
36 Unknown = 0, ///< Custom section.
37 Text, ///< Text section.
38 BSS, ///< BSS section.
40 Data, ///< Data section.
41 DataRel, ///< Data that has relocations.
42 DataRelLocal, ///< Data that only has local relocations.
45 ROData, ///< Readonly data section.
46 DataRelRO, ///< Readonly data with non-local relocations.
47 DataRelROLocal, ///< Readonly data with local relocations only.
49 /// Mergable sections.
50 RODataMergeStr, ///< Readonly data section: nul-terminated strings.
51 RODataMergeConst, ///< Readonly data section: fixed-length constants.
53 /// Small sections - These sections contains "short" data, and should be
54 /// placed "near" the GP.
55 SmallData, ///< Small data section
56 SmallBSS, ///< Small bss section
57 SmallROData, ///< Small readonly section
59 /// Thread local data.
60 ThreadData, ///< Initialized TLS data objects
61 ThreadBSS ///< Uninitialized TLS data objects
64 static inline bool isReadOnly(Kind K) {
65 return (K == SectionKind::ROData ||
66 K == SectionKind::RODataMergeConst ||
67 K == SectionKind::RODataMergeStr ||
68 K == SectionKind::SmallROData);
71 static inline bool isBSS(Kind K) {
72 return (K == SectionKind::BSS ||
73 K == SectionKind::SmallBSS);
77 namespace SectionFlags {
78 const unsigned Invalid = -1U;
79 const unsigned None = 0;
80 const unsigned Code = 1 << 0; ///< Section contains code
81 const unsigned Writeable = 1 << 1; ///< Section is writeable
82 const unsigned BSS = 1 << 2; ///< Section contains only zeroes
83 const unsigned Mergeable = 1 << 3; ///< Section contains mergeable data
84 const unsigned Strings = 1 << 4; ///< Section contains C-type strings
85 const unsigned TLS = 1 << 5; ///< Section contains thread-local data
86 const unsigned Debug = 1 << 6; ///< Section contains debug data
87 const unsigned Linkonce = 1 << 7; ///< Section is linkonce
88 const unsigned Small = 1 << 8; ///< Section is small
89 const unsigned TypeFlags = 0xFF;
90 // Some gap for future flags
91 const unsigned Named = 1 << 23; ///< Section is named
92 const unsigned EntitySize = 0xFF << 24; ///< Entity size for mergeable stuff
94 static inline unsigned getEntitySize(unsigned Flags) {
95 return (Flags >> 24) & 0xFF;
98 static inline unsigned setEntitySize(unsigned Flags, unsigned Size) {
99 return ((Flags & ~EntitySize) | ((Size & 0xFF) << 24));
103 static inline unsigned getEmptyKey() { return Invalid; }
104 static inline unsigned getTombstoneKey() { return Invalid - 1; }
105 static unsigned getHashValue(const unsigned &Key) { return Key; }
106 static bool isEqual(unsigned LHS, unsigned RHS) { return LHS == RHS; }
107 static bool isPod() { return true; }
110 typedef DenseMap<unsigned, std::string, KeyInfo> FlagsStringsMapType;
120 friend class TargetAsmInfo;
121 friend class StringMapEntry<Section>;
122 friend class StringMap<Section>;
126 explicit Section(unsigned F = SectionFlags::Invalid):Flags(F) { }
130 bool isNamed() const { return Flags & SectionFlags::Named; }
131 unsigned getEntitySize() const { return (Flags >> 24) & 0xFF; }
133 const std::string& getName() const { return Name; }
134 unsigned getFlags() const { return Flags; }
137 /// TargetAsmInfo - This class is intended to be used as a base class for asm
138 /// properties and features specific to the target.
139 class TargetAsmInfo {
141 mutable StringMap<Section> Sections;
142 mutable SectionFlags::FlagsStringsMapType FlagsStrings;
144 /// TM - The current TargetMachine.
145 const TargetMachine &TM;
147 //===------------------------------------------------------------------===//
148 // Properties to be set by the target writer, used to configure asm printer.
151 /// TextSection - Section directive for standard text.
153 const Section *TextSection; // Defaults to ".text".
155 /// DataSection - Section directive for standard data.
157 const Section *DataSection; // Defaults to ".data".
159 /// BSSSection - Section directive for uninitialized data. Null if this
160 /// target doesn't support a BSS section.
162 const char *BSSSection; // Default to ".bss".
163 const Section *BSSSection_;
165 /// ReadOnlySection - This is the directive that is emitted to switch to a
166 /// read-only section for constant data (e.g. data declared const,
168 const Section *ReadOnlySection; // Defaults to NULL
170 /// SmallDataSection - This is the directive that is emitted to switch to a
171 /// small data section.
173 const Section *SmallDataSection; // Defaults to NULL
175 /// SmallBSSSection - This is the directive that is emitted to switch to a
176 /// small bss section.
178 const Section *SmallBSSSection; // Defaults to NULL
180 /// SmallRODataSection - This is the directive that is emitted to switch to
181 /// a small read-only data section.
183 const Section *SmallRODataSection; // Defaults to NULL
185 /// TLSDataSection - Section directive for Thread Local data.
187 const Section *TLSDataSection; // Defaults to ".tdata".
189 /// TLSBSSSection - Section directive for Thread Local uninitialized data.
190 /// Null if this target doesn't support a BSS section.
192 const Section *TLSBSSSection; // Defaults to ".tbss".
194 /// ZeroFillDirective - Directive for emitting a global to the ZeroFill
195 /// section on this target. Null if this target doesn't support zerofill.
196 const char *ZeroFillDirective; // Default is null.
198 /// NonexecutableStackDirective - Directive for declaring to the
199 /// linker and beyond that the emitted code does not require stack
200 /// memory to be executable.
201 const char *NonexecutableStackDirective; // Default is null.
203 /// NeedsSet - True if target asm treats expressions in data directives
204 /// as linktime-relocatable. For assembly-time computation, we need to
205 /// use a .set. Thus:
208 /// is computed at assembly time, while
210 /// is relocated if the relative locations of x and y change at linktime.
211 /// We want both these things in different places.
212 bool NeedsSet; // Defaults to false.
214 /// MaxInstLength - This is the maximum possible length of an instruction,
215 /// which is needed to compute the size of an inline asm.
216 unsigned MaxInstLength; // Defaults to 4.
218 /// PCSymbol - The symbol used to represent the current PC. Used in PC
219 /// relative expressions.
220 const char *PCSymbol; // Defaults to "$".
222 /// SeparatorChar - This character, if specified, is used to separate
223 /// instructions from each other when on the same line. This is used to
224 /// measure inline asm instructions.
225 char SeparatorChar; // Defaults to ';'
227 /// CommentColumn - This indicates the comment num (zero-based) at
228 /// which asm comments should be printed.
229 unsigned CommentColumn; // Defaults to 60
231 /// CommentString - This indicates the comment character used by the
233 const char *CommentString; // Defaults to "#"
235 /// FirstOperandColumn - The output column where the first operand
236 /// should be printed
237 unsigned FirstOperandColumn; // Defaults to 0 (ignored)
239 /// MaxOperandLength - The maximum length of any printed asm
241 unsigned MaxOperandLength; // Defaults to 0 (ignored)
243 /// GlobalPrefix - If this is set to a non-empty string, it is prepended
244 /// onto all global symbols. This is often used for "_" or ".".
245 const char *GlobalPrefix; // Defaults to ""
247 /// PrivateGlobalPrefix - This prefix is used for globals like constant
248 /// pool entries that are completely private to the .s file and should not
249 /// have names in the .o file. This is often "." or "L".
250 const char *PrivateGlobalPrefix; // Defaults to "."
252 /// LinkerPrivateGlobalPrefix - This prefix is used for symbols that should
253 /// be passed through the assembler but be removed by the linker. This
254 /// is "l" on Darwin, currently used for some ObjC metadata.
255 const char *LinkerPrivateGlobalPrefix; // Defaults to ""
257 /// JumpTableSpecialLabelPrefix - If not null, a extra (dead) label is
258 /// emitted before jump tables with the specified prefix.
259 const char *JumpTableSpecialLabelPrefix; // Default to null.
261 /// GlobalVarAddrPrefix/Suffix - If these are nonempty, these strings
262 /// will enclose any GlobalVariable (that isn't a function)
264 const char *GlobalVarAddrPrefix; // Defaults to ""
265 const char *GlobalVarAddrSuffix; // Defaults to ""
267 /// FunctionAddrPrefix/Suffix - If these are nonempty, these strings
268 /// will enclose any GlobalVariable that points to a function.
269 /// For example, this is used by the IA64 backend to materialize
270 /// function descriptors, by decorating the ".data8" object with the
271 /// @verbatim @fptr( ) @endverbatim
272 /// link-relocation operator.
274 const char *FunctionAddrPrefix; // Defaults to ""
275 const char *FunctionAddrSuffix; // Defaults to ""
277 /// PersonalityPrefix/Suffix - If these are nonempty, these strings will
278 /// enclose any personality function in the common frame section.
280 const char *PersonalityPrefix; // Defaults to ""
281 const char *PersonalitySuffix; // Defaults to ""
283 /// NeedsIndirectEncoding - If set, we need to set the indirect encoding bit
286 bool NeedsIndirectEncoding; // Defaults to false
288 /// InlineAsmStart/End - If these are nonempty, they contain a directive to
289 /// emit before and after an inline assembly statement.
290 const char *InlineAsmStart; // Defaults to "#APP\n"
291 const char *InlineAsmEnd; // Defaults to "#NO_APP\n"
293 /// AssemblerDialect - Which dialect of an assembler variant to use.
294 unsigned AssemblerDialect; // Defaults to 0
296 /// AllowQuotesInName - This is true if the assembler allows for complex
297 /// symbol names to be surrounded in quotes. This defaults to false.
298 bool AllowQuotesInName;
300 //===--- Data Emission Directives -------------------------------------===//
302 /// ZeroDirective - this should be set to the directive used to get some
303 /// number of zero bytes emitted to the current section. Common cases are
304 /// "\t.zero\t" and "\t.space\t". If this is set to null, the
305 /// Data*bitsDirective's will be used to emit zero bytes.
306 const char *ZeroDirective; // Defaults to "\t.zero\t"
307 const char *ZeroDirectiveSuffix; // Defaults to ""
309 /// AsciiDirective - This directive allows emission of an ascii string with
310 /// the standard C escape characters embedded into it.
311 const char *AsciiDirective; // Defaults to "\t.ascii\t"
313 /// AscizDirective - If not null, this allows for special handling of
314 /// zero terminated strings on this target. This is commonly supported as
315 /// ".asciz". If a target doesn't support this, it can be set to null.
316 const char *AscizDirective; // Defaults to "\t.asciz\t"
318 /// DataDirectives - These directives are used to output some unit of
319 /// integer data to the current section. If a data directive is set to
320 /// null, smaller data directives will be used to emit the large sizes.
321 const char *Data8bitsDirective; // Defaults to "\t.byte\t"
322 const char *Data16bitsDirective; // Defaults to "\t.short\t"
323 const char *Data32bitsDirective; // Defaults to "\t.long\t"
324 const char *Data64bitsDirective; // Defaults to "\t.quad\t"
326 /// getDataASDirective - Return the directive that should be used to emit
327 /// data of the specified size to the specified numeric address space.
328 virtual const char *getDataASDirective(unsigned Size, unsigned AS) const {
329 assert(AS != 0 && "Don't know the directives for default addr space");
333 //===--- Alignment Information ----------------------------------------===//
335 /// AlignDirective - The directive used to emit round up to an alignment
338 const char *AlignDirective; // Defaults to "\t.align\t"
340 /// AlignmentIsInBytes - If this is true (the default) then the asmprinter
341 /// emits ".align N" directives, where N is the number of bytes to align to.
342 /// Otherwise, it emits ".align log2(N)", e.g. 3 to align to an 8 byte
344 bool AlignmentIsInBytes; // Defaults to true
346 /// TextAlignFillValue - If non-zero, this is used to fill the executable
347 /// space created as the result of a alignment directive.
348 unsigned TextAlignFillValue;
350 //===--- Section Switching Directives ---------------------------------===//
352 /// SwitchToSectionDirective - This is the directive used when we want to
353 /// emit a global to an arbitrary section. The section name is emited after
355 const char *SwitchToSectionDirective; // Defaults to "\t.section\t"
357 /// TextSectionStartSuffix - This is printed after each start of section
358 /// directive for text sections.
359 const char *TextSectionStartSuffix; // Defaults to "".
361 /// DataSectionStartSuffix - This is printed after each start of section
362 /// directive for data sections.
363 const char *DataSectionStartSuffix; // Defaults to "".
365 /// SectionEndDirectiveSuffix - If non-null, the asm printer will close each
366 /// section with the section name and this suffix printed.
367 const char *SectionEndDirectiveSuffix;// Defaults to null.
369 /// ConstantPoolSection - This is the section that we SwitchToSection right
370 /// before emitting the constant pool for a function.
371 const char *ConstantPoolSection; // Defaults to "\t.section .rodata"
373 /// JumpTableDataSection - This is the section that we SwitchToSection right
374 /// before emitting the jump tables for a function when the relocation model
376 const char *JumpTableDataSection; // Defaults to "\t.section .rodata"
378 /// JumpTableDirective - if non-null, the directive to emit before a jump
380 const char *JumpTableDirective;
382 /// CStringSection - If not null, this allows for special handling of
383 /// cstring constants (null terminated string that does not contain any
384 /// other null bytes) on this target. This is commonly supported as
386 const char *CStringSection; // Defaults to NULL
387 const Section *CStringSection_;
389 /// StaticCtorsSection - This is the directive that is emitted to switch to
390 /// a section to emit the static constructor list.
391 /// Defaults to "\t.section .ctors,\"aw\",@progbits".
392 const char *StaticCtorsSection;
394 /// StaticDtorsSection - This is the directive that is emitted to switch to
395 /// a section to emit the static destructor list.
396 /// Defaults to "\t.section .dtors,\"aw\",@progbits".
397 const char *StaticDtorsSection;
399 //===--- Global Variable Emission Directives --------------------------===//
401 /// GlobalDirective - This is the directive used to declare a global entity.
403 const char *GlobalDirective; // Defaults to NULL.
405 /// ExternDirective - This is the directive used to declare external
408 const char *ExternDirective; // Defaults to NULL.
410 /// SetDirective - This is the name of a directive that can be used to tell
411 /// the assembler to set the value of a variable to some expression.
412 const char *SetDirective; // Defaults to null.
414 /// LCOMMDirective - This is the name of a directive (if supported) that can
415 /// be used to efficiently declare a local (internal) block of zero
416 /// initialized data in the .bss/.data section. The syntax expected is:
417 /// @verbatim <LCOMMDirective> SYMBOLNAME LENGTHINBYTES, ALIGNMENT
419 const char *LCOMMDirective; // Defaults to null.
421 const char *COMMDirective; // Defaults to "\t.comm\t".
423 /// COMMDirectiveTakesAlignment - True if COMMDirective take a third
424 /// argument that specifies the alignment of the declaration.
425 bool COMMDirectiveTakesAlignment; // Defaults to true.
427 /// HasDotTypeDotSizeDirective - True if the target has .type and .size
428 /// directives, this is true for most ELF targets.
429 bool HasDotTypeDotSizeDirective; // Defaults to true.
431 /// HasSingleParameterDotFile - True if the target has a single parameter
432 /// .file directive, this is true for ELF targets.
433 bool HasSingleParameterDotFile; // Defaults to true.
435 /// UsedDirective - This directive, if non-null, is used to declare a global
436 /// as being used somehow that the assembler can't see. This prevents dead
437 /// code elimination on some targets.
438 const char *UsedDirective; // Defaults to null.
440 /// WeakRefDirective - This directive, if non-null, is used to declare a
441 /// global as being a weak undefined symbol.
442 const char *WeakRefDirective; // Defaults to null.
444 /// WeakDefDirective - This directive, if non-null, is used to declare a
445 /// global as being a weak defined symbol.
446 const char *WeakDefDirective; // Defaults to null.
448 /// HiddenDirective - This directive, if non-null, is used to declare a
449 /// global or function as having hidden visibility.
450 const char *HiddenDirective; // Defaults to "\t.hidden\t".
452 /// ProtectedDirective - This directive, if non-null, is used to declare a
453 /// global or function as having protected visibility.
454 const char *ProtectedDirective; // Defaults to "\t.protected\t".
456 //===--- Dwarf Emission Directives -----------------------------------===//
458 /// AbsoluteDebugSectionOffsets - True if we should emit abolute section
459 /// offsets for debug information. Defaults to false.
460 bool AbsoluteDebugSectionOffsets;
462 /// AbsoluteEHSectionOffsets - True if we should emit abolute section
463 /// offsets for EH information. Defaults to false.
464 bool AbsoluteEHSectionOffsets;
466 /// HasLEB128 - True if target asm supports leb128 directives.
468 bool HasLEB128; // Defaults to false.
470 /// hasDotLocAndDotFile - True if target asm supports .loc and .file
471 /// directives for emitting debugging information.
473 bool HasDotLocAndDotFile; // Defaults to false.
475 /// SupportsDebugInformation - True if target supports emission of debugging
477 bool SupportsDebugInformation;
479 /// SupportsExceptionHandling - True if target supports
480 /// exception handling.
482 bool SupportsExceptionHandling; // Defaults to false.
484 /// RequiresFrameSection - true if the Dwarf2 output needs a frame section
486 bool DwarfRequiresFrameSection; // Defaults to true.
488 /// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection is used to
489 /// encode inline subroutine information.
490 bool DwarfUsesInlineInfoSection; // Defaults to false.
492 /// Is_EHSymbolPrivate - If set, the "_foo.eh" is made private so that it
493 /// doesn't show up in the symbol table of the object file.
494 bool Is_EHSymbolPrivate; // Defaults to true.
496 /// GlobalEHDirective - This is the directive used to make exception frame
497 /// tables globally visible.
499 const char *GlobalEHDirective; // Defaults to NULL.
501 /// SupportsWeakEmptyEHFrame - True if target assembler and linker will
502 /// handle a weak_definition of constant 0 for an omitted EH frame.
503 bool SupportsWeakOmittedEHFrame; // Defaults to true.
505 /// DwarfSectionOffsetDirective - Special section offset directive.
506 const char* DwarfSectionOffsetDirective; // Defaults to NULL
508 /// DwarfAbbrevSection - Section directive for Dwarf abbrev.
510 const char *DwarfAbbrevSection; // Defaults to ".debug_abbrev".
512 /// DwarfInfoSection - Section directive for Dwarf info.
514 const char *DwarfInfoSection; // Defaults to ".debug_info".
516 /// DwarfLineSection - Section directive for Dwarf info.
518 const char *DwarfLineSection; // Defaults to ".debug_line".
520 /// DwarfFrameSection - Section directive for Dwarf info.
522 const char *DwarfFrameSection; // Defaults to ".debug_frame".
524 /// DwarfPubNamesSection - Section directive for Dwarf info.
526 const char *DwarfPubNamesSection; // Defaults to ".debug_pubnames".
528 /// DwarfPubTypesSection - Section directive for Dwarf info.
530 const char *DwarfPubTypesSection; // Defaults to ".debug_pubtypes".
532 /// DwarfDebugInlineSection - Section directive for inline info.
534 const char *DwarfDebugInlineSection; // Defaults to ".debug_inlined"
536 /// DwarfStrSection - Section directive for Dwarf info.
538 const char *DwarfStrSection; // Defaults to ".debug_str".
540 /// DwarfLocSection - Section directive for Dwarf info.
542 const char *DwarfLocSection; // Defaults to ".debug_loc".
544 /// DwarfARangesSection - Section directive for Dwarf info.
546 const char *DwarfARangesSection; // Defaults to ".debug_aranges".
548 /// DwarfRangesSection - Section directive for Dwarf info.
550 const char *DwarfRangesSection; // Defaults to ".debug_ranges".
552 /// DwarfMacroInfoSection - Section directive for DWARF macro info.
554 const char *DwarfMacroInfoSection; // Defaults to ".debug_macinfo".
556 /// DwarfEHFrameSection - Section directive for Exception frames.
558 const char *DwarfEHFrameSection; // Defaults to ".eh_frame".
560 /// DwarfExceptionSection - Section directive for Exception table.
562 const char *DwarfExceptionSection; // Defaults to ".gcc_except_table".
564 //===--- CBE Asm Translation Table -----------------------------------===//
566 const char *const *AsmTransCBE; // Defaults to empty
569 explicit TargetAsmInfo(const TargetMachine &TM);
570 virtual ~TargetAsmInfo();
572 const Section* getNamedSection(const char *Name,
573 unsigned Flags = SectionFlags::None,
574 bool Override = false) const;
575 const Section* getUnnamedSection(const char *Directive,
576 unsigned Flags = SectionFlags::None,
577 bool Override = false) const;
579 /// Measure the specified inline asm to determine an approximation of its
581 virtual unsigned getInlineAsmLength(const char *Str) const;
583 /// emitUsedDirectiveFor - This hook allows targets to selectively decide
584 /// not to emit the UsedDirective for some symbols in llvm.used.
585 // FIXME: REMOVE this (rdar://7071300)
586 virtual bool emitUsedDirectiveFor(const GlobalValue *GV,
587 Mangler *Mang) const {
591 /// PreferredEHDataFormat - This hook allows the target to select data
592 /// format used for encoding pointers in exception handling data. Reason is
593 /// 0 for data, 1 for code labels, 2 for function pointers. Global is true
594 /// if the symbol can be relocated.
595 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
598 /// SectionKindForGlobal - This hook allows the target to select proper
599 /// section kind used for global emission.
600 // FIXME: Eliminate this.
601 virtual SectionKind::Kind
602 SectionKindForGlobal(const GlobalValue *GV) const;
604 /// RelocBehaviour - Describes how relocations should be treated when
605 /// selecting sections. Reloc::Global bit should be set if global
606 /// relocations should force object to be placed in read-write
607 /// sections. Reloc::Local bit should be set if local relocations should
608 /// force object to be placed in read-write sections.
609 virtual unsigned RelocBehaviour() const;
611 /// SectionFlagsForGlobal - This hook allows the target to select proper
612 /// section flags either for given global or for section.
613 // FIXME: Eliminate this.
615 SectionFlagsForGlobal(const GlobalValue *GV = NULL,
616 const char* name = NULL) const;
618 /// SectionForGlobal - This hooks returns proper section name for given
619 /// global with all necessary flags and marks.
620 // FIXME: Eliminate this.
621 virtual const Section* SectionForGlobal(const GlobalValue *GV) const;
623 // Helper methods for SectionForGlobal
624 // FIXME: Eliminate this.
625 virtual std::string UniqueSectionForGlobal(const GlobalValue* GV,
626 SectionKind::Kind kind) const;
628 const std::string &getSectionFlags(unsigned Flags) const;
629 virtual std::string printSectionFlags(unsigned flags) const { return ""; }
631 // FIXME: Eliminate this.
632 virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
633 virtual const Section* SelectSectionForMachineConst(const Type *Ty) const;
635 /// getSLEB128Size - Compute the number of bytes required for a signed
637 static unsigned getSLEB128Size(int Value);
639 /// getULEB128Size - Compute the number of bytes required for an unsigned
641 static unsigned getULEB128Size(unsigned Value);
643 // Data directive accessors.
645 const char *getData8bitsDirective(unsigned AS = 0) const {
646 return AS == 0 ? Data8bitsDirective : getDataASDirective(8, AS);
648 const char *getData16bitsDirective(unsigned AS = 0) const {
649 return AS == 0 ? Data16bitsDirective : getDataASDirective(16, AS);
651 const char *getData32bitsDirective(unsigned AS = 0) const {
652 return AS == 0 ? Data32bitsDirective : getDataASDirective(32, AS);
654 const char *getData64bitsDirective(unsigned AS = 0) const {
655 return AS == 0 ? Data64bitsDirective : getDataASDirective(64, AS);
661 const Section *getTextSection() const {
664 const Section *getDataSection() const {
667 const char *getBSSSection() const {
670 const Section *getBSSSection_() const {
673 const Section *getReadOnlySection() const {
674 return ReadOnlySection;
676 const Section *getSmallDataSection() const {
677 return SmallDataSection;
679 const Section *getSmallBSSSection() const {
680 return SmallBSSSection;
682 const Section *getSmallRODataSection() const {
683 return SmallRODataSection;
685 const Section *getTLSDataSection() const {
686 return TLSDataSection;
688 const Section *getTLSBSSSection() const {
689 return TLSBSSSection;
691 const char *getZeroFillDirective() const {
692 return ZeroFillDirective;
694 const char *getNonexecutableStackDirective() const {
695 return NonexecutableStackDirective;
697 bool needsSet() const {
700 const char *getPCSymbol() const {
703 char getSeparatorChar() const {
704 return SeparatorChar;
706 unsigned getCommentColumn() const {
707 return CommentColumn;
709 const char *getCommentString() const {
710 return CommentString;
712 unsigned getOperandColumn(int operand) const {
713 return FirstOperandColumn + (MaxOperandLength+1)*(operand-1);
715 const char *getGlobalPrefix() const {
718 const char *getPrivateGlobalPrefix() const {
719 return PrivateGlobalPrefix;
721 const char *getLinkerPrivateGlobalPrefix() const {
722 return LinkerPrivateGlobalPrefix;
724 const char *getJumpTableSpecialLabelPrefix() const {
725 return JumpTableSpecialLabelPrefix;
727 const char *getGlobalVarAddrPrefix() const {
728 return GlobalVarAddrPrefix;
730 const char *getGlobalVarAddrSuffix() const {
731 return GlobalVarAddrSuffix;
733 const char *getFunctionAddrPrefix() const {
734 return FunctionAddrPrefix;
736 const char *getFunctionAddrSuffix() const {
737 return FunctionAddrSuffix;
739 const char *getPersonalityPrefix() const {
740 return PersonalityPrefix;
742 const char *getPersonalitySuffix() const {
743 return PersonalitySuffix;
745 bool getNeedsIndirectEncoding() const {
746 return NeedsIndirectEncoding;
748 const char *getInlineAsmStart() const {
749 return InlineAsmStart;
751 const char *getInlineAsmEnd() const {
754 unsigned getAssemblerDialect() const {
755 return AssemblerDialect;
757 bool doesAllowQuotesInName() const {
758 return AllowQuotesInName;
760 const char *getZeroDirective() const {
761 return ZeroDirective;
763 const char *getZeroDirectiveSuffix() const {
764 return ZeroDirectiveSuffix;
766 const char *getAsciiDirective() const {
767 return AsciiDirective;
769 const char *getAscizDirective() const {
770 return AscizDirective;
772 const char *getJumpTableDirective() const {
773 return JumpTableDirective;
775 const char *getAlignDirective() const {
776 return AlignDirective;
778 bool getAlignmentIsInBytes() const {
779 return AlignmentIsInBytes;
781 unsigned getTextAlignFillValue() const {
782 return TextAlignFillValue;
784 const char *getSwitchToSectionDirective() const {
785 return SwitchToSectionDirective;
787 const char *getTextSectionStartSuffix() const {
788 return TextSectionStartSuffix;
790 const char *getDataSectionStartSuffix() const {
791 return DataSectionStartSuffix;
793 const char *getSectionEndDirectiveSuffix() const {
794 return SectionEndDirectiveSuffix;
796 const char *getConstantPoolSection() const {
797 return ConstantPoolSection;
799 const char *getJumpTableDataSection() const {
800 return JumpTableDataSection;
802 const char *getCStringSection() const {
803 return CStringSection;
805 const Section *getCStringSection_() const {
806 return CStringSection_;
808 const char *getStaticCtorsSection() const {
809 return StaticCtorsSection;
811 const char *getStaticDtorsSection() const {
812 return StaticDtorsSection;
814 const char *getGlobalDirective() const {
815 return GlobalDirective;
817 const char *getExternDirective() const {
818 return ExternDirective;
820 const char *getSetDirective() const {
823 const char *getLCOMMDirective() const {
824 return LCOMMDirective;
826 const char *getCOMMDirective() const {
827 return COMMDirective;
829 bool getCOMMDirectiveTakesAlignment() const {
830 return COMMDirectiveTakesAlignment;
832 bool hasDotTypeDotSizeDirective() const {
833 return HasDotTypeDotSizeDirective;
835 bool hasSingleParameterDotFile() const {
836 return HasSingleParameterDotFile;
838 const char *getUsedDirective() const {
839 return UsedDirective;
841 const char *getWeakRefDirective() const {
842 return WeakRefDirective;
844 const char *getWeakDefDirective() const {
845 return WeakDefDirective;
847 const char *getHiddenDirective() const {
848 return HiddenDirective;
850 const char *getProtectedDirective() const {
851 return ProtectedDirective;
853 bool isAbsoluteDebugSectionOffsets() const {
854 return AbsoluteDebugSectionOffsets;
856 bool isAbsoluteEHSectionOffsets() const {
857 return AbsoluteEHSectionOffsets;
859 bool hasLEB128() const {
862 bool hasDotLocAndDotFile() const {
863 return HasDotLocAndDotFile;
865 bool doesSupportDebugInformation() const {
866 return SupportsDebugInformation;
868 bool doesSupportExceptionHandling() const {
869 return SupportsExceptionHandling;
871 bool doesDwarfRequireFrameSection() const {
872 return DwarfRequiresFrameSection;
874 bool doesDwarfUsesInlineInfoSection() const {
875 return DwarfUsesInlineInfoSection;
877 bool is_EHSymbolPrivate() const {
878 return Is_EHSymbolPrivate;
880 const char *getGlobalEHDirective() const {
881 return GlobalEHDirective;
883 bool getSupportsWeakOmittedEHFrame() const {
884 return SupportsWeakOmittedEHFrame;
886 const char *getDwarfSectionOffsetDirective() const {
887 return DwarfSectionOffsetDirective;
889 const char *getDwarfAbbrevSection() const {
890 return DwarfAbbrevSection;
892 const char *getDwarfInfoSection() const {
893 return DwarfInfoSection;
895 const char *getDwarfLineSection() const {
896 return DwarfLineSection;
898 const char *getDwarfFrameSection() const {
899 return DwarfFrameSection;
901 const char *getDwarfPubNamesSection() const {
902 return DwarfPubNamesSection;
904 const char *getDwarfPubTypesSection() const {
905 return DwarfPubTypesSection;
907 const char *getDwarfDebugInlineSection() const {
908 return DwarfDebugInlineSection;
910 const char *getDwarfStrSection() const {
911 return DwarfStrSection;
913 const char *getDwarfLocSection() const {
914 return DwarfLocSection;
916 const char *getDwarfARangesSection() const {
917 return DwarfARangesSection;
919 const char *getDwarfRangesSection() const {
920 return DwarfRangesSection;
922 const char *getDwarfMacroInfoSection() const {
923 return DwarfMacroInfoSection;
925 const char *getDwarfEHFrameSection() const {
926 return DwarfEHFrameSection;
928 const char *getDwarfExceptionSection() const {
929 return DwarfExceptionSection;
931 const char *const *getAsmCBE() const {