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 Data, ///< Data section
39 DataRel, ///< Contains data that has relocations
40 DataRelLocal, ///< Contains data that has only local relocations
42 ROData, ///< Readonly data section
43 DataRelRO, ///< Contains data that is otherwise readonly
44 DataRelROLocal, ///< Contains r/o data with only local relocations
45 RODataMergeStr, ///< Readonly data section (mergeable strings)
46 RODataMergeConst, ///< Readonly data section (mergeable constants)
47 SmallData, ///< Small data section
48 SmallBSS, ///< Small bss section
49 SmallROData, ///< Small readonly section
50 ThreadData, ///< Initialized TLS data objects
51 ThreadBSS ///< Uninitialized TLS data objects
54 static inline bool isReadOnly(Kind K) {
55 return (K == SectionKind::ROData ||
56 K == SectionKind::RODataMergeConst ||
57 K == SectionKind::RODataMergeStr ||
58 K == SectionKind::SmallROData);
61 static inline bool isBSS(Kind K) {
62 return (K == SectionKind::BSS ||
63 K == SectionKind::SmallBSS);
67 namespace SectionFlags {
68 const unsigned Invalid = -1U;
69 const unsigned None = 0;
70 const unsigned Code = 1 << 0; ///< Section contains code
71 const unsigned Writeable = 1 << 1; ///< Section is writeable
72 const unsigned BSS = 1 << 2; ///< Section contains only zeroes
73 const unsigned Mergeable = 1 << 3; ///< Section contains mergeable data
74 const unsigned Strings = 1 << 4; ///< Section contains C-type strings
75 const unsigned TLS = 1 << 5; ///< Section contains thread-local data
76 const unsigned Debug = 1 << 6; ///< Section contains debug data
77 const unsigned Linkonce = 1 << 7; ///< Section is linkonce
78 const unsigned Small = 1 << 8; ///< Section is small
79 const unsigned TypeFlags = 0xFF;
80 // Some gap for future flags
81 const unsigned Named = 1 << 23; ///< Section is named
82 const unsigned EntitySize = 0xFF << 24; ///< Entity size for mergeable stuff
84 static inline unsigned getEntitySize(unsigned Flags) {
85 return (Flags >> 24) & 0xFF;
88 static inline unsigned setEntitySize(unsigned Flags, unsigned Size) {
89 return ((Flags & ~EntitySize) | ((Size & 0xFF) << 24));
93 static inline unsigned getEmptyKey() { return Invalid; }
94 static inline unsigned getTombstoneKey() { return Invalid - 1; }
95 static unsigned getHashValue(const unsigned &Key) { return Key; }
96 static bool isEqual(unsigned LHS, unsigned RHS) { return LHS == RHS; }
97 static bool isPod() { return true; }
100 typedef DenseMap<unsigned, std::string, KeyInfo> FlagsStringsMapType;
110 friend class TargetAsmInfo;
111 friend class StringMapEntry<Section>;
112 friend class StringMap<Section>;
116 explicit Section(unsigned F = SectionFlags::Invalid):Flags(F) { }
120 bool isNamed() const { return Flags & SectionFlags::Named; }
121 unsigned getEntitySize() const { return (Flags >> 24) & 0xFF; }
123 const std::string& getName() const { return Name; }
124 unsigned getFlags() const { return Flags; }
127 /// TargetAsmInfo - This class is intended to be used as a base class for asm
128 /// properties and features specific to the target.
129 class TargetAsmInfo {
131 mutable StringMap<Section> Sections;
132 mutable SectionFlags::FlagsStringsMapType FlagsStrings;
134 /// TM - The current TargetMachine.
135 const TargetMachine &TM;
137 //===------------------------------------------------------------------===//
138 // Properties to be set by the target writer, used to configure asm printer.
141 /// TextSection - Section directive for standard text.
143 const Section *TextSection; // Defaults to ".text".
145 /// DataSection - Section directive for standard data.
147 const Section *DataSection; // Defaults to ".data".
149 /// BSSSection - Section directive for uninitialized data. Null if this
150 /// target doesn't support a BSS section.
152 const char *BSSSection; // Default to ".bss".
153 const Section *BSSSection_;
155 /// ReadOnlySection - This is the directive that is emitted to switch to a
156 /// read-only section for constant data (e.g. data declared const,
158 const Section *ReadOnlySection; // Defaults to NULL
160 /// SmallDataSection - This is the directive that is emitted to switch to a
161 /// small data section.
163 const Section *SmallDataSection; // Defaults to NULL
165 /// SmallBSSSection - This is the directive that is emitted to switch to a
166 /// small bss section.
168 const Section *SmallBSSSection; // Defaults to NULL
170 /// SmallRODataSection - This is the directive that is emitted to switch to
171 /// a small read-only data section.
173 const Section *SmallRODataSection; // Defaults to NULL
175 /// TLSDataSection - Section directive for Thread Local data.
177 const Section *TLSDataSection; // Defaults to ".tdata".
179 /// TLSBSSSection - Section directive for Thread Local uninitialized data.
180 /// Null if this target doesn't support a BSS section.
182 const Section *TLSBSSSection; // Defaults to ".tbss".
184 /// ZeroFillDirective - Directive for emitting a global to the ZeroFill
185 /// section on this target. Null if this target doesn't support zerofill.
186 const char *ZeroFillDirective; // Default is null.
188 /// NonexecutableStackDirective - Directive for declaring to the
189 /// linker and beyond that the emitted code does not require stack
190 /// memory to be executable.
191 const char *NonexecutableStackDirective; // Default is null.
193 /// NeedsSet - True if target asm treats expressions in data directives
194 /// as linktime-relocatable. For assembly-time computation, we need to
195 /// use a .set. Thus:
198 /// is computed at assembly time, while
200 /// is relocated if the relative locations of x and y change at linktime.
201 /// We want both these things in different places.
202 bool NeedsSet; // Defaults to false.
204 /// MaxInstLength - This is the maximum possible length of an instruction,
205 /// which is needed to compute the size of an inline asm.
206 unsigned MaxInstLength; // Defaults to 4.
208 /// PCSymbol - The symbol used to represent the current PC. Used in PC
209 /// relative expressions.
210 const char *PCSymbol; // Defaults to "$".
212 /// SeparatorChar - This character, if specified, is used to separate
213 /// instructions from each other when on the same line. This is used to
214 /// measure inline asm instructions.
215 char SeparatorChar; // Defaults to ';'
217 /// CommentColumn - This indicates the comment num (zero-based) at
218 /// which asm comments should be printed.
219 unsigned CommentColumn; // Defaults to 60
221 /// CommentString - This indicates the comment character used by the
223 const char *CommentString; // Defaults to "#"
225 /// GlobalPrefix - If this is set to a non-empty string, it is prepended
226 /// onto all global symbols. This is often used for "_" or ".".
227 const char *GlobalPrefix; // Defaults to ""
229 /// PrivateGlobalPrefix - This prefix is used for globals like constant
230 /// pool entries that are completely private to the .s file and should not
231 /// have names in the .o file. This is often "." or "L".
232 const char *PrivateGlobalPrefix; // Defaults to "."
234 /// LessPrivateGlobalPrefix - This prefix is used for symbols that should
235 /// be passed through the assembler but be removed by the linker. This
236 /// is "l" on Darwin, currently used for some ObjC metadata.
237 const char *LessPrivateGlobalPrefix; // Defaults to ""
239 /// JumpTableSpecialLabelPrefix - If not null, a extra (dead) label is
240 /// emitted before jump tables with the specified prefix.
241 const char *JumpTableSpecialLabelPrefix; // Default to null.
243 /// GlobalVarAddrPrefix/Suffix - If these are nonempty, these strings
244 /// will enclose any GlobalVariable (that isn't a function)
246 const char *GlobalVarAddrPrefix; // Defaults to ""
247 const char *GlobalVarAddrSuffix; // Defaults to ""
249 /// FunctionAddrPrefix/Suffix - If these are nonempty, these strings
250 /// will enclose any GlobalVariable that points to a function.
251 /// For example, this is used by the IA64 backend to materialize
252 /// function descriptors, by decorating the ".data8" object with the
253 /// @verbatim @fptr( ) @endverbatim
254 /// link-relocation operator.
256 const char *FunctionAddrPrefix; // Defaults to ""
257 const char *FunctionAddrSuffix; // Defaults to ""
259 /// PersonalityPrefix/Suffix - If these are nonempty, these strings will
260 /// enclose any personality function in the common frame section.
262 const char *PersonalityPrefix; // Defaults to ""
263 const char *PersonalitySuffix; // Defaults to ""
265 /// NeedsIndirectEncoding - If set, we need to set the indirect encoding bit
268 bool NeedsIndirectEncoding; // Defaults to false
270 /// InlineAsmStart/End - If these are nonempty, they contain a directive to
271 /// emit before and after an inline assembly statement.
272 const char *InlineAsmStart; // Defaults to "#APP\n"
273 const char *InlineAsmEnd; // Defaults to "#NO_APP\n"
275 /// AssemblerDialect - Which dialect of an assembler variant to use.
276 unsigned AssemblerDialect; // Defaults to 0
278 /// AllowQuotesInName - This is true if the assembler allows for complex
279 /// symbol names to be surrounded in quotes. This defaults to false.
280 bool AllowQuotesInName;
282 //===--- Data Emission Directives -------------------------------------===//
284 /// ZeroDirective - this should be set to the directive used to get some
285 /// number of zero bytes emitted to the current section. Common cases are
286 /// "\t.zero\t" and "\t.space\t". If this is set to null, the
287 /// Data*bitsDirective's will be used to emit zero bytes.
288 const char *ZeroDirective; // Defaults to "\t.zero\t"
289 const char *ZeroDirectiveSuffix; // Defaults to ""
291 /// AsciiDirective - This directive allows emission of an ascii string with
292 /// the standard C escape characters embedded into it.
293 const char *AsciiDirective; // Defaults to "\t.ascii\t"
295 /// AscizDirective - If not null, this allows for special handling of
296 /// zero terminated strings on this target. This is commonly supported as
297 /// ".asciz". If a target doesn't support this, it can be set to null.
298 const char *AscizDirective; // Defaults to "\t.asciz\t"
300 /// DataDirectives - These directives are used to output some unit of
301 /// integer data to the current section. If a data directive is set to
302 /// null, smaller data directives will be used to emit the large sizes.
303 const char *Data8bitsDirective; // Defaults to "\t.byte\t"
304 const char *Data16bitsDirective; // Defaults to "\t.short\t"
305 const char *Data32bitsDirective; // Defaults to "\t.long\t"
306 const char *Data64bitsDirective; // Defaults to "\t.quad\t"
308 /// getASDirective - Targets can override it to provide different data
309 /// directives for various sizes and non-default address spaces.
310 virtual const char *getASDirective(unsigned size,
312 assert(AS > 0 && "Dont know the directives for default addr space");
316 //===--- Alignment Information ----------------------------------------===//
318 /// AlignDirective - The directive used to emit round up to an alignment
321 const char *AlignDirective; // Defaults to "\t.align\t"
323 /// AlignmentIsInBytes - If this is true (the default) then the asmprinter
324 /// emits ".align N" directives, where N is the number of bytes to align to.
325 /// Otherwise, it emits ".align log2(N)", e.g. 3 to align to an 8 byte
327 bool AlignmentIsInBytes; // Defaults to true
329 /// TextAlignFillValue - If non-zero, this is used to fill the executable
330 /// space created as the result of a alignment directive.
331 unsigned TextAlignFillValue;
333 //===--- Section Switching Directives ---------------------------------===//
335 /// SwitchToSectionDirective - This is the directive used when we want to
336 /// emit a global to an arbitrary section. The section name is emited after
338 const char *SwitchToSectionDirective; // Defaults to "\t.section\t"
340 /// TextSectionStartSuffix - This is printed after each start of section
341 /// directive for text sections.
342 const char *TextSectionStartSuffix; // Defaults to "".
344 /// DataSectionStartSuffix - This is printed after each start of section
345 /// directive for data sections.
346 const char *DataSectionStartSuffix; // Defaults to "".
348 /// SectionEndDirectiveSuffix - If non-null, the asm printer will close each
349 /// section with the section name and this suffix printed.
350 const char *SectionEndDirectiveSuffix;// Defaults to null.
352 /// ConstantPoolSection - This is the section that we SwitchToSection right
353 /// before emitting the constant pool for a function.
354 const char *ConstantPoolSection; // Defaults to "\t.section .rodata"
356 /// JumpTableDataSection - This is the section that we SwitchToSection right
357 /// before emitting the jump tables for a function when the relocation model
359 const char *JumpTableDataSection; // Defaults to "\t.section .rodata"
361 /// JumpTableDirective - if non-null, the directive to emit before a jump
363 const char *JumpTableDirective;
365 /// CStringSection - If not null, this allows for special handling of
366 /// cstring constants (null terminated string that does not contain any
367 /// other null bytes) on this target. This is commonly supported as
369 const char *CStringSection; // Defaults to NULL
370 const Section *CStringSection_;
372 /// StaticCtorsSection - This is the directive that is emitted to switch to
373 /// a section to emit the static constructor list.
374 /// Defaults to "\t.section .ctors,\"aw\",@progbits".
375 const char *StaticCtorsSection;
377 /// StaticDtorsSection - This is the directive that is emitted to switch to
378 /// a section to emit the static destructor list.
379 /// Defaults to "\t.section .dtors,\"aw\",@progbits".
380 const char *StaticDtorsSection;
382 //===--- Global Variable Emission Directives --------------------------===//
384 /// GlobalDirective - This is the directive used to declare a global entity.
386 const char *GlobalDirective; // Defaults to NULL.
388 /// ExternDirective - This is the directive used to declare external
391 const char *ExternDirective; // Defaults to NULL.
393 /// SetDirective - This is the name of a directive that can be used to tell
394 /// the assembler to set the value of a variable to some expression.
395 const char *SetDirective; // Defaults to null.
397 /// LCOMMDirective - This is the name of a directive (if supported) that can
398 /// be used to efficiently declare a local (internal) block of zero
399 /// initialized data in the .bss/.data section. The syntax expected is:
400 /// @verbatim <LCOMMDirective> SYMBOLNAME LENGTHINBYTES, ALIGNMENT
402 const char *LCOMMDirective; // Defaults to null.
404 const char *COMMDirective; // Defaults to "\t.comm\t".
406 /// COMMDirectiveTakesAlignment - True if COMMDirective take a third
407 /// argument that specifies the alignment of the declaration.
408 bool COMMDirectiveTakesAlignment; // Defaults to true.
410 /// HasDotTypeDotSizeDirective - True if the target has .type and .size
411 /// directives, this is true for most ELF targets.
412 bool HasDotTypeDotSizeDirective; // Defaults to true.
414 /// HasSingleParameterDotFile - True if the target has a single parameter
415 /// .file directive, this is true for ELF targets.
416 bool HasSingleParameterDotFile; // Defaults to true.
418 /// UsedDirective - This directive, if non-null, is used to declare a global
419 /// as being used somehow that the assembler can't see. This prevents dead
420 /// code elimination on some targets.
421 const char *UsedDirective; // Defaults to null.
423 /// WeakRefDirective - This directive, if non-null, is used to declare a
424 /// global as being a weak undefined symbol.
425 const char *WeakRefDirective; // Defaults to null.
427 /// WeakDefDirective - This directive, if non-null, is used to declare a
428 /// global as being a weak defined symbol.
429 const char *WeakDefDirective; // Defaults to null.
431 /// HiddenDirective - This directive, if non-null, is used to declare a
432 /// global or function as having hidden visibility.
433 const char *HiddenDirective; // Defaults to "\t.hidden\t".
435 /// ProtectedDirective - This directive, if non-null, is used to declare a
436 /// global or function as having protected visibility.
437 const char *ProtectedDirective; // Defaults to "\t.protected\t".
439 //===--- Dwarf Emission Directives -----------------------------------===//
441 /// AbsoluteDebugSectionOffsets - True if we should emit abolute section
442 /// offsets for debug information. Defaults to false.
443 bool AbsoluteDebugSectionOffsets;
445 /// AbsoluteEHSectionOffsets - True if we should emit abolute section
446 /// offsets for EH information. Defaults to false.
447 bool AbsoluteEHSectionOffsets;
449 /// HasLEB128 - True if target asm supports leb128 directives.
451 bool HasLEB128; // Defaults to false.
453 /// hasDotLocAndDotFile - True if target asm supports .loc and .file
454 /// directives for emitting debugging information.
456 bool HasDotLocAndDotFile; // Defaults to false.
458 /// SupportsDebugInformation - True if target supports emission of debugging
460 bool SupportsDebugInformation;
462 /// SupportsExceptionHandling - True if target supports
463 /// exception handling.
465 bool SupportsExceptionHandling; // Defaults to false.
467 /// RequiresFrameSection - true if the Dwarf2 output needs a frame section
469 bool DwarfRequiresFrameSection; // Defaults to true.
471 /// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection is used to
472 /// encode inline subroutine information.
473 bool DwarfUsesInlineInfoSection; // Defaults to false.
475 /// NonLocalEHFrameLabel - If set, the EH_frame label needs to be non-local.
477 bool NonLocalEHFrameLabel; // Defaults to false.
479 /// GlobalEHDirective - This is the directive used to make exception frame
480 /// tables globally visible.
482 const char *GlobalEHDirective; // Defaults to NULL.
484 /// SupportsWeakEmptyEHFrame - True if target assembler and linker will
485 /// handle a weak_definition of constant 0 for an omitted EH frame.
486 bool SupportsWeakOmittedEHFrame; // Defaults to true.
488 /// DwarfSectionOffsetDirective - Special section offset directive.
489 const char* DwarfSectionOffsetDirective; // Defaults to NULL
491 /// DwarfAbbrevSection - Section directive for Dwarf abbrev.
493 const char *DwarfAbbrevSection; // Defaults to ".debug_abbrev".
495 /// DwarfInfoSection - Section directive for Dwarf info.
497 const char *DwarfInfoSection; // Defaults to ".debug_info".
499 /// DwarfLineSection - Section directive for Dwarf info.
501 const char *DwarfLineSection; // Defaults to ".debug_line".
503 /// DwarfFrameSection - Section directive for Dwarf info.
505 const char *DwarfFrameSection; // Defaults to ".debug_frame".
507 /// DwarfPubNamesSection - Section directive for Dwarf info.
509 const char *DwarfPubNamesSection; // Defaults to ".debug_pubnames".
511 /// DwarfPubTypesSection - Section directive for Dwarf info.
513 const char *DwarfPubTypesSection; // Defaults to ".debug_pubtypes".
515 /// DwarfDebugInlineSection - Section directive for inline info.
517 const char *DwarfDebugInlineSection; // Defaults to ".debug_inlined"
519 /// DwarfStrSection - Section directive for Dwarf info.
521 const char *DwarfStrSection; // Defaults to ".debug_str".
523 /// DwarfLocSection - Section directive for Dwarf info.
525 const char *DwarfLocSection; // Defaults to ".debug_loc".
527 /// DwarfARangesSection - Section directive for Dwarf info.
529 const char *DwarfARangesSection; // Defaults to ".debug_aranges".
531 /// DwarfRangesSection - Section directive for Dwarf info.
533 const char *DwarfRangesSection; // Defaults to ".debug_ranges".
535 /// DwarfMacroInfoSection - Section directive for DWARF macro info.
537 const char *DwarfMacroInfoSection; // Defaults to ".debug_macinfo".
539 /// DwarfEHFrameSection - Section directive for Exception frames.
541 const char *DwarfEHFrameSection; // Defaults to ".eh_frame".
543 /// DwarfExceptionSection - Section directive for Exception table.
545 const char *DwarfExceptionSection; // Defaults to ".gcc_except_table".
547 //===--- CBE Asm Translation Table -----------------------------------===//
549 const char *const *AsmTransCBE; // Defaults to empty
552 explicit TargetAsmInfo(const TargetMachine &TM);
553 virtual ~TargetAsmInfo();
555 const Section* getNamedSection(const char *Name,
556 unsigned Flags = SectionFlags::None,
557 bool Override = false) const;
558 const Section* getUnnamedSection(const char *Directive,
559 unsigned Flags = SectionFlags::None,
560 bool Override = false) const;
562 /// Measure the specified inline asm to determine an approximation of its
564 virtual unsigned getInlineAsmLength(const char *Str) const;
566 /// ExpandInlineAsm - This hook allows the target to expand an inline asm
567 /// call to be explicit llvm code if it wants to. This is useful for
568 /// turning simple inline asms into LLVM intrinsics, which gives the
569 /// compiler more information about the behavior of the code.
570 virtual bool ExpandInlineAsm(CallInst *CI) const {
574 /// emitUsedDirectiveFor - This hook allows targets to selectively decide
575 /// not to emit the UsedDirective for some symbols in llvm.used.
576 virtual bool emitUsedDirectiveFor(const GlobalValue *GV,
577 Mangler *Mang) const {
581 /// PreferredEHDataFormat - This hook allows the target to select data
582 /// format used for encoding pointers in exception handling data. Reason is
583 /// 0 for data, 1 for code labels, 2 for function pointers. Global is true
584 /// if the symbol can be relocated.
585 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
588 /// SectionKindForGlobal - This hook allows the target to select proper
589 /// section kind used for global emission.
590 virtual SectionKind::Kind
591 SectionKindForGlobal(const GlobalValue *GV) const;
593 /// RelocBehaviour - Describes how relocations should be treated when
594 /// selecting sections. Reloc::Global bit should be set if global
595 /// relocations should force object to be placed in read-write
596 /// sections. Reloc::Local bit should be set if local relocations should
597 /// force object to be placed in read-write sections.
598 virtual unsigned RelocBehaviour() const;
600 /// SectionFlagsForGlobal - This hook allows the target to select proper
601 /// section flags either for given global or for section.
603 SectionFlagsForGlobal(const GlobalValue *GV = NULL,
604 const char* name = NULL) const;
606 /// SectionForGlobal - This hooks returns proper section name for given
607 /// global with all necessary flags and marks.
608 virtual const Section* SectionForGlobal(const GlobalValue *GV) const;
610 // Helper methods for SectionForGlobal
611 virtual std::string UniqueSectionForGlobal(const GlobalValue* GV,
612 SectionKind::Kind kind) const;
614 const std::string& getSectionFlags(unsigned Flags) const;
615 virtual std::string printSectionFlags(unsigned flags) const { return ""; }
617 virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
619 virtual const Section* SelectSectionForMachineConst(const Type *Ty) const;
621 /// getSLEB128Size - Compute the number of bytes required for a signed
624 static unsigned getSLEB128Size(int Value);
626 /// getULEB128Size - Compute the number of bytes required for an unsigned
629 static unsigned getULEB128Size(unsigned Value);
631 // Data directive accessors
633 const char *getData8bitsDirective(unsigned AS = 0) const {
634 return AS == 0 ? Data8bitsDirective : getASDirective(8, AS);
636 const char *getData16bitsDirective(unsigned AS = 0) const {
637 return AS == 0 ? Data16bitsDirective : getASDirective(16, AS);
639 const char *getData32bitsDirective(unsigned AS = 0) const {
640 return AS == 0 ? Data32bitsDirective : getASDirective(32, AS);
642 const char *getData64bitsDirective(unsigned AS = 0) const {
643 return AS == 0 ? Data64bitsDirective : getASDirective(64, AS);
649 const Section *getTextSection() const {
652 const Section *getDataSection() const {
655 const char *getBSSSection() const {
658 const Section *getBSSSection_() const {
661 const Section *getReadOnlySection() const {
662 return ReadOnlySection;
664 const Section *getSmallDataSection() const {
665 return SmallDataSection;
667 const Section *getSmallBSSSection() const {
668 return SmallBSSSection;
670 const Section *getSmallRODataSection() const {
671 return SmallRODataSection;
673 const Section *getTLSDataSection() const {
674 return TLSDataSection;
676 const Section *getTLSBSSSection() const {
677 return TLSBSSSection;
679 const char *getZeroFillDirective() const {
680 return ZeroFillDirective;
682 const char *getNonexecutableStackDirective() const {
683 return NonexecutableStackDirective;
685 bool needsSet() const {
688 const char *getPCSymbol() const {
691 char getSeparatorChar() const {
692 return SeparatorChar;
694 unsigned getCommentColumn() const {
695 return CommentColumn;
697 const char *getCommentString() const {
698 return CommentString;
700 const char *getGlobalPrefix() const {
703 const char *getPrivateGlobalPrefix() const {
704 return PrivateGlobalPrefix;
706 /// EHGlobalPrefix - Prefix for EH_frame and the .eh symbols.
707 /// This is normally PrivateGlobalPrefix, but some targets want
708 /// these symbols to be visible.
709 virtual const char *getEHGlobalPrefix() const {
710 return PrivateGlobalPrefix;
712 const char *getLessPrivateGlobalPrefix() const {
713 return LessPrivateGlobalPrefix;
715 const char *getJumpTableSpecialLabelPrefix() const {
716 return JumpTableSpecialLabelPrefix;
718 const char *getGlobalVarAddrPrefix() const {
719 return GlobalVarAddrPrefix;
721 const char *getGlobalVarAddrSuffix() const {
722 return GlobalVarAddrSuffix;
724 const char *getFunctionAddrPrefix() const {
725 return FunctionAddrPrefix;
727 const char *getFunctionAddrSuffix() const {
728 return FunctionAddrSuffix;
730 const char *getPersonalityPrefix() const {
731 return PersonalityPrefix;
733 const char *getPersonalitySuffix() const {
734 return PersonalitySuffix;
736 bool getNeedsIndirectEncoding() const {
737 return NeedsIndirectEncoding;
739 const char *getInlineAsmStart() const {
740 return InlineAsmStart;
742 const char *getInlineAsmEnd() const {
745 unsigned getAssemblerDialect() const {
746 return AssemblerDialect;
748 bool doesAllowQuotesInName() const {
749 return AllowQuotesInName;
751 const char *getZeroDirective() const {
752 return ZeroDirective;
754 const char *getZeroDirectiveSuffix() const {
755 return ZeroDirectiveSuffix;
757 const char *getAsciiDirective() const {
758 return AsciiDirective;
760 const char *getAscizDirective() const {
761 return AscizDirective;
763 const char *getJumpTableDirective() const {
764 return JumpTableDirective;
766 const char *getAlignDirective() const {
767 return AlignDirective;
769 bool getAlignmentIsInBytes() const {
770 return AlignmentIsInBytes;
772 unsigned getTextAlignFillValue() const {
773 return TextAlignFillValue;
775 const char *getSwitchToSectionDirective() const {
776 return SwitchToSectionDirective;
778 const char *getTextSectionStartSuffix() const {
779 return TextSectionStartSuffix;
781 const char *getDataSectionStartSuffix() const {
782 return DataSectionStartSuffix;
784 const char *getSectionEndDirectiveSuffix() const {
785 return SectionEndDirectiveSuffix;
787 const char *getConstantPoolSection() const {
788 return ConstantPoolSection;
790 const char *getJumpTableDataSection() const {
791 return JumpTableDataSection;
793 const char *getCStringSection() const {
794 return CStringSection;
796 const Section *getCStringSection_() const {
797 return CStringSection_;
799 const char *getStaticCtorsSection() const {
800 return StaticCtorsSection;
802 const char *getStaticDtorsSection() const {
803 return StaticDtorsSection;
805 const char *getGlobalDirective() const {
806 return GlobalDirective;
808 const char *getExternDirective() const {
809 return ExternDirective;
811 const char *getSetDirective() const {
814 const char *getLCOMMDirective() const {
815 return LCOMMDirective;
817 const char *getCOMMDirective() const {
818 return COMMDirective;
820 bool getCOMMDirectiveTakesAlignment() const {
821 return COMMDirectiveTakesAlignment;
823 bool hasDotTypeDotSizeDirective() const {
824 return HasDotTypeDotSizeDirective;
826 bool hasSingleParameterDotFile() const {
827 return HasSingleParameterDotFile;
829 const char *getUsedDirective() const {
830 return UsedDirective;
832 const char *getWeakRefDirective() const {
833 return WeakRefDirective;
835 const char *getWeakDefDirective() const {
836 return WeakDefDirective;
838 const char *getHiddenDirective() const {
839 return HiddenDirective;
841 const char *getProtectedDirective() const {
842 return ProtectedDirective;
844 bool isAbsoluteDebugSectionOffsets() const {
845 return AbsoluteDebugSectionOffsets;
847 bool isAbsoluteEHSectionOffsets() const {
848 return AbsoluteEHSectionOffsets;
850 bool hasLEB128() const {
853 bool hasDotLocAndDotFile() const {
854 return HasDotLocAndDotFile;
856 bool doesSupportDebugInformation() const {
857 return SupportsDebugInformation;
859 bool doesSupportExceptionHandling() const {
860 return SupportsExceptionHandling;
862 bool doesDwarfRequireFrameSection() const {
863 return DwarfRequiresFrameSection;
865 bool doesDwarfUsesInlineInfoSection() const {
866 return DwarfUsesInlineInfoSection;
868 bool doesRequireNonLocalEHFrameLabel() const {
869 return NonLocalEHFrameLabel;
871 const char *getGlobalEHDirective() const {
872 return GlobalEHDirective;
874 bool getSupportsWeakOmittedEHFrame() const {
875 return SupportsWeakOmittedEHFrame;
877 const char *getDwarfSectionOffsetDirective() const {
878 return DwarfSectionOffsetDirective;
880 const char *getDwarfAbbrevSection() const {
881 return DwarfAbbrevSection;
883 const char *getDwarfInfoSection() const {
884 return DwarfInfoSection;
886 const char *getDwarfLineSection() const {
887 return DwarfLineSection;
889 const char *getDwarfFrameSection() const {
890 return DwarfFrameSection;
892 const char *getDwarfPubNamesSection() const {
893 return DwarfPubNamesSection;
895 const char *getDwarfPubTypesSection() const {
896 return DwarfPubTypesSection;
898 const char *getDwarfDebugInlineSection() const {
899 return DwarfDebugInlineSection;
901 const char *getDwarfStrSection() const {
902 return DwarfStrSection;
904 const char *getDwarfLocSection() const {
905 return DwarfLocSection;
907 const char *getDwarfARangesSection() const {
908 return DwarfARangesSection;
910 const char *getDwarfRangesSection() const {
911 return DwarfRangesSection;
913 const char *getDwarfMacroInfoSection() const {
914 return DwarfMacroInfoSection;
916 const char *getDwarfEHFrameSection() const {
917 return DwarfEHFrameSection;
919 const char *getDwarfExceptionSection() const {
920 return DwarfExceptionSection;
922 const char *const *getAsmCBE() const {