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 /// SectionFlagsForGlobal - This hook allows the target to select proper
605 /// section flags either for given global or for section.
606 // FIXME: Eliminate this.
608 SectionFlagsForGlobal(const GlobalValue *GV = NULL,
609 const char* name = NULL) const;
611 /// SectionForGlobal - This hooks returns proper section name for given
612 /// global with all necessary flags and marks.
613 // FIXME: Eliminate this.
614 virtual const Section* SectionForGlobal(const GlobalValue *GV) const;
616 // Helper methods for SectionForGlobal
617 // FIXME: Eliminate this.
618 virtual std::string UniqueSectionForGlobal(const GlobalValue* GV,
619 SectionKind::Kind kind) const;
621 const std::string &getSectionFlags(unsigned Flags) const;
622 virtual std::string printSectionFlags(unsigned flags) const { return ""; }
624 // FIXME: Eliminate this.
625 virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
626 virtual const Section* SelectSectionForMachineConst(const Type *Ty) const;
628 /// getSLEB128Size - Compute the number of bytes required for a signed
630 static unsigned getSLEB128Size(int Value);
632 /// getULEB128Size - Compute the number of bytes required for an unsigned
634 static unsigned getULEB128Size(unsigned Value);
636 // Data directive accessors.
638 const char *getData8bitsDirective(unsigned AS = 0) const {
639 return AS == 0 ? Data8bitsDirective : getDataASDirective(8, AS);
641 const char *getData16bitsDirective(unsigned AS = 0) const {
642 return AS == 0 ? Data16bitsDirective : getDataASDirective(16, AS);
644 const char *getData32bitsDirective(unsigned AS = 0) const {
645 return AS == 0 ? Data32bitsDirective : getDataASDirective(32, AS);
647 const char *getData64bitsDirective(unsigned AS = 0) const {
648 return AS == 0 ? Data64bitsDirective : getDataASDirective(64, AS);
654 const Section *getTextSection() const {
657 const Section *getDataSection() const {
660 const char *getBSSSection() const {
663 const Section *getBSSSection_() const {
666 const Section *getReadOnlySection() const {
667 return ReadOnlySection;
669 const Section *getSmallDataSection() const {
670 return SmallDataSection;
672 const Section *getSmallBSSSection() const {
673 return SmallBSSSection;
675 const Section *getSmallRODataSection() const {
676 return SmallRODataSection;
678 const Section *getTLSDataSection() const {
679 return TLSDataSection;
681 const Section *getTLSBSSSection() const {
682 return TLSBSSSection;
684 const char *getZeroFillDirective() const {
685 return ZeroFillDirective;
687 const char *getNonexecutableStackDirective() const {
688 return NonexecutableStackDirective;
690 bool needsSet() const {
693 const char *getPCSymbol() const {
696 char getSeparatorChar() const {
697 return SeparatorChar;
699 unsigned getCommentColumn() const {
700 return CommentColumn;
702 const char *getCommentString() const {
703 return CommentString;
705 unsigned getOperandColumn(int operand) const {
706 return FirstOperandColumn + (MaxOperandLength+1)*(operand-1);
708 const char *getGlobalPrefix() const {
711 const char *getPrivateGlobalPrefix() const {
712 return PrivateGlobalPrefix;
714 const char *getLinkerPrivateGlobalPrefix() const {
715 return LinkerPrivateGlobalPrefix;
717 const char *getJumpTableSpecialLabelPrefix() const {
718 return JumpTableSpecialLabelPrefix;
720 const char *getGlobalVarAddrPrefix() const {
721 return GlobalVarAddrPrefix;
723 const char *getGlobalVarAddrSuffix() const {
724 return GlobalVarAddrSuffix;
726 const char *getFunctionAddrPrefix() const {
727 return FunctionAddrPrefix;
729 const char *getFunctionAddrSuffix() const {
730 return FunctionAddrSuffix;
732 const char *getPersonalityPrefix() const {
733 return PersonalityPrefix;
735 const char *getPersonalitySuffix() const {
736 return PersonalitySuffix;
738 bool getNeedsIndirectEncoding() const {
739 return NeedsIndirectEncoding;
741 const char *getInlineAsmStart() const {
742 return InlineAsmStart;
744 const char *getInlineAsmEnd() const {
747 unsigned getAssemblerDialect() const {
748 return AssemblerDialect;
750 bool doesAllowQuotesInName() const {
751 return AllowQuotesInName;
753 const char *getZeroDirective() const {
754 return ZeroDirective;
756 const char *getZeroDirectiveSuffix() const {
757 return ZeroDirectiveSuffix;
759 const char *getAsciiDirective() const {
760 return AsciiDirective;
762 const char *getAscizDirective() const {
763 return AscizDirective;
765 const char *getJumpTableDirective() const {
766 return JumpTableDirective;
768 const char *getAlignDirective() const {
769 return AlignDirective;
771 bool getAlignmentIsInBytes() const {
772 return AlignmentIsInBytes;
774 unsigned getTextAlignFillValue() const {
775 return TextAlignFillValue;
777 const char *getSwitchToSectionDirective() const {
778 return SwitchToSectionDirective;
780 const char *getTextSectionStartSuffix() const {
781 return TextSectionStartSuffix;
783 const char *getDataSectionStartSuffix() const {
784 return DataSectionStartSuffix;
786 const char *getSectionEndDirectiveSuffix() const {
787 return SectionEndDirectiveSuffix;
789 const char *getConstantPoolSection() const {
790 return ConstantPoolSection;
792 const char *getJumpTableDataSection() const {
793 return JumpTableDataSection;
795 const char *getCStringSection() const {
796 return CStringSection;
798 const Section *getCStringSection_() const {
799 return CStringSection_;
801 const char *getStaticCtorsSection() const {
802 return StaticCtorsSection;
804 const char *getStaticDtorsSection() const {
805 return StaticDtorsSection;
807 const char *getGlobalDirective() const {
808 return GlobalDirective;
810 const char *getExternDirective() const {
811 return ExternDirective;
813 const char *getSetDirective() const {
816 const char *getLCOMMDirective() const {
817 return LCOMMDirective;
819 const char *getCOMMDirective() const {
820 return COMMDirective;
822 bool getCOMMDirectiveTakesAlignment() const {
823 return COMMDirectiveTakesAlignment;
825 bool hasDotTypeDotSizeDirective() const {
826 return HasDotTypeDotSizeDirective;
828 bool hasSingleParameterDotFile() const {
829 return HasSingleParameterDotFile;
831 const char *getUsedDirective() const {
832 return UsedDirective;
834 const char *getWeakRefDirective() const {
835 return WeakRefDirective;
837 const char *getWeakDefDirective() const {
838 return WeakDefDirective;
840 const char *getHiddenDirective() const {
841 return HiddenDirective;
843 const char *getProtectedDirective() const {
844 return ProtectedDirective;
846 bool isAbsoluteDebugSectionOffsets() const {
847 return AbsoluteDebugSectionOffsets;
849 bool isAbsoluteEHSectionOffsets() const {
850 return AbsoluteEHSectionOffsets;
852 bool hasLEB128() const {
855 bool hasDotLocAndDotFile() const {
856 return HasDotLocAndDotFile;
858 bool doesSupportDebugInformation() const {
859 return SupportsDebugInformation;
861 bool doesSupportExceptionHandling() const {
862 return SupportsExceptionHandling;
864 bool doesDwarfRequireFrameSection() const {
865 return DwarfRequiresFrameSection;
867 bool doesDwarfUsesInlineInfoSection() const {
868 return DwarfUsesInlineInfoSection;
870 bool is_EHSymbolPrivate() const {
871 return Is_EHSymbolPrivate;
873 const char *getGlobalEHDirective() const {
874 return GlobalEHDirective;
876 bool getSupportsWeakOmittedEHFrame() const {
877 return SupportsWeakOmittedEHFrame;
879 const char *getDwarfSectionOffsetDirective() const {
880 return DwarfSectionOffsetDirective;
882 const char *getDwarfAbbrevSection() const {
883 return DwarfAbbrevSection;
885 const char *getDwarfInfoSection() const {
886 return DwarfInfoSection;
888 const char *getDwarfLineSection() const {
889 return DwarfLineSection;
891 const char *getDwarfFrameSection() const {
892 return DwarfFrameSection;
894 const char *getDwarfPubNamesSection() const {
895 return DwarfPubNamesSection;
897 const char *getDwarfPubTypesSection() const {
898 return DwarfPubTypesSection;
900 const char *getDwarfDebugInlineSection() const {
901 return DwarfDebugInlineSection;
903 const char *getDwarfStrSection() const {
904 return DwarfStrSection;
906 const char *getDwarfLocSection() const {
907 return DwarfLocSection;
909 const char *getDwarfARangesSection() const {
910 return DwarfARangesSection;
912 const char *getDwarfRangesSection() const {
913 return DwarfRangesSection;
915 const char *getDwarfMacroInfoSection() const {
916 return DwarfMacroInfoSection;
918 const char *getDwarfEHFrameSection() const {
919 return DwarfEHFrameSection;
921 const char *getDwarfExceptionSection() const {
922 return DwarfExceptionSection;
924 const char *const *getAsmCBE() const {