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 /// Thread local data.
54 ThreadData, ///< Initialized TLS data objects
55 ThreadBSS ///< Uninitialized TLS data objects
58 static inline bool isReadOnly(Kind K) {
59 return (K == SectionKind::ROData ||
60 K == SectionKind::DataRelRO ||
61 K == SectionKind::DataRelROLocal ||
62 K == SectionKind::RODataMergeConst ||
63 K == SectionKind::RODataMergeStr);
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 TypeFlags = 0xFF;
79 // Some gap for future flags
81 /// Named - True if this section should be printed with ".section <name>",
82 /// false if the section name is something like ".const".
83 const unsigned Named = 1 << 23; ///< Section is named
84 const unsigned EntitySize = 0xFF << 24; ///< Entity size for mergeable stuff
86 static inline unsigned getEntitySize(unsigned Flags) {
87 return (Flags >> 24) & 0xFF;
90 static inline unsigned setEntitySize(unsigned Flags, unsigned Size) {
91 return ((Flags & ~EntitySize) | ((Size & 0xFF) << 24));
95 static inline unsigned getEmptyKey() { return Invalid; }
96 static inline unsigned getTombstoneKey() { return Invalid - 1; }
97 static unsigned getHashValue(const unsigned &Key) { return Key; }
98 static bool isEqual(unsigned LHS, unsigned RHS) { return LHS == RHS; }
99 static bool isPod() { return true; }
102 typedef DenseMap<unsigned, std::string, KeyInfo> FlagsStringsMapType;
112 friend class TargetAsmInfo;
113 friend class StringMapEntry<Section>;
114 friend class StringMap<Section>;
118 explicit Section(unsigned F = SectionFlags::Invalid) : Flags(F) { }
122 unsigned getEntitySize() const { return (Flags >> 24) & 0xFF; }
124 const std::string &getName() const { return Name; }
125 unsigned getFlags() const { return Flags; }
127 bool hasFlag(unsigned F) const { return (Flags & F) != 0; }
130 /// TargetAsmInfo - This class is intended to be used as a base class for asm
131 /// properties and features specific to the target.
132 class TargetAsmInfo {
134 mutable StringMap<Section> Sections;
135 mutable SectionFlags::FlagsStringsMapType FlagsStrings;
137 /// TM - The current TargetMachine.
138 const TargetMachine &TM;
140 //===------------------------------------------------------------------===//
141 // Properties to be set by the target writer, used to configure asm printer.
144 /// TextSection - Section directive for standard text.
146 const Section *TextSection; // Defaults to ".text".
148 /// DataSection - Section directive for standard data.
150 const Section *DataSection; // Defaults to ".data".
152 /// BSSSection - Section directive for uninitialized data. Null if this
153 /// target doesn't support a BSS section.
155 const char *BSSSection; // Default to ".bss".
156 const Section *BSSSection_;
158 /// ReadOnlySection - This is the directive that is emitted to switch to a
159 /// read-only section for constant data (e.g. data declared const,
161 const Section *ReadOnlySection; // Defaults to NULL
163 /// TLSDataSection - Section directive for Thread Local data.
165 const Section *TLSDataSection; // Defaults to ".tdata".
167 /// TLSBSSSection - Section directive for Thread Local uninitialized data.
168 /// Null if this target doesn't support a BSS section.
170 const Section *TLSBSSSection; // Defaults to ".tbss".
172 /// ZeroFillDirective - Directive for emitting a global to the ZeroFill
173 /// section on this target. Null if this target doesn't support zerofill.
174 const char *ZeroFillDirective; // Default is null.
176 /// NonexecutableStackDirective - Directive for declaring to the
177 /// linker and beyond that the emitted code does not require stack
178 /// memory to be executable.
179 const char *NonexecutableStackDirective; // Default is null.
181 /// NeedsSet - True if target asm treats expressions in data directives
182 /// as linktime-relocatable. For assembly-time computation, we need to
183 /// use a .set. Thus:
186 /// is computed at assembly time, while
188 /// is relocated if the relative locations of x and y change at linktime.
189 /// We want both these things in different places.
190 bool NeedsSet; // Defaults to false.
192 /// MaxInstLength - This is the maximum possible length of an instruction,
193 /// which is needed to compute the size of an inline asm.
194 unsigned MaxInstLength; // Defaults to 4.
196 /// PCSymbol - The symbol used to represent the current PC. Used in PC
197 /// relative expressions.
198 const char *PCSymbol; // Defaults to "$".
200 /// SeparatorChar - This character, if specified, is used to separate
201 /// instructions from each other when on the same line. This is used to
202 /// measure inline asm instructions.
203 char SeparatorChar; // Defaults to ';'
205 /// CommentColumn - This indicates the comment num (zero-based) at
206 /// which asm comments should be printed.
207 unsigned CommentColumn; // Defaults to 60
209 /// CommentString - This indicates the comment character used by the
211 const char *CommentString; // Defaults to "#"
213 /// FirstOperandColumn - The output column where the first operand
214 /// should be printed
215 unsigned FirstOperandColumn; // Defaults to 0 (ignored)
217 /// MaxOperandLength - The maximum length of any printed asm
219 unsigned MaxOperandLength; // Defaults to 0 (ignored)
221 /// GlobalPrefix - If this is set to a non-empty string, it is prepended
222 /// onto all global symbols. This is often used for "_" or ".".
223 const char *GlobalPrefix; // Defaults to ""
225 /// PrivateGlobalPrefix - This prefix is used for globals like constant
226 /// pool entries that are completely private to the .s file and should not
227 /// have names in the .o file. This is often "." or "L".
228 const char *PrivateGlobalPrefix; // Defaults to "."
230 /// LinkerPrivateGlobalPrefix - This prefix is used for symbols that should
231 /// be passed through the assembler but be removed by the linker. This
232 /// is "l" on Darwin, currently used for some ObjC metadata.
233 const char *LinkerPrivateGlobalPrefix; // Defaults to ""
235 /// JumpTableSpecialLabelPrefix - If not null, a extra (dead) label is
236 /// emitted before jump tables with the specified prefix.
237 const char *JumpTableSpecialLabelPrefix; // Default to null.
239 /// GlobalVarAddrPrefix/Suffix - If these are nonempty, these strings
240 /// will enclose any GlobalVariable (that isn't a function)
242 const char *GlobalVarAddrPrefix; // Defaults to ""
243 const char *GlobalVarAddrSuffix; // Defaults to ""
245 /// FunctionAddrPrefix/Suffix - If these are nonempty, these strings
246 /// will enclose any GlobalVariable that points to a function.
248 const char *FunctionAddrPrefix; // Defaults to ""
249 const char *FunctionAddrSuffix; // Defaults to ""
251 /// PersonalityPrefix/Suffix - If these are nonempty, these strings will
252 /// enclose any personality function in the common frame section.
254 const char *PersonalityPrefix; // Defaults to ""
255 const char *PersonalitySuffix; // Defaults to ""
257 /// NeedsIndirectEncoding - If set, we need to set the indirect encoding bit
260 bool NeedsIndirectEncoding; // Defaults to false
262 /// InlineAsmStart/End - If these are nonempty, they contain a directive to
263 /// emit before and after an inline assembly statement.
264 const char *InlineAsmStart; // Defaults to "#APP\n"
265 const char *InlineAsmEnd; // Defaults to "#NO_APP\n"
267 /// AssemblerDialect - Which dialect of an assembler variant to use.
268 unsigned AssemblerDialect; // Defaults to 0
270 /// AllowQuotesInName - This is true if the assembler allows for complex
271 /// symbol names to be surrounded in quotes. This defaults to false.
272 bool AllowQuotesInName;
274 //===--- Data Emission Directives -------------------------------------===//
276 /// ZeroDirective - this should be set to the directive used to get some
277 /// number of zero bytes emitted to the current section. Common cases are
278 /// "\t.zero\t" and "\t.space\t". If this is set to null, the
279 /// Data*bitsDirective's will be used to emit zero bytes.
280 const char *ZeroDirective; // Defaults to "\t.zero\t"
281 const char *ZeroDirectiveSuffix; // Defaults to ""
283 /// AsciiDirective - This directive allows emission of an ascii string with
284 /// the standard C escape characters embedded into it.
285 const char *AsciiDirective; // Defaults to "\t.ascii\t"
287 /// AscizDirective - If not null, this allows for special handling of
288 /// zero terminated strings on this target. This is commonly supported as
289 /// ".asciz". If a target doesn't support this, it can be set to null.
290 const char *AscizDirective; // Defaults to "\t.asciz\t"
292 /// DataDirectives - These directives are used to output some unit of
293 /// integer data to the current section. If a data directive is set to
294 /// null, smaller data directives will be used to emit the large sizes.
295 const char *Data8bitsDirective; // Defaults to "\t.byte\t"
296 const char *Data16bitsDirective; // Defaults to "\t.short\t"
297 const char *Data32bitsDirective; // Defaults to "\t.long\t"
298 const char *Data64bitsDirective; // Defaults to "\t.quad\t"
300 /// getDataASDirective - Return the directive that should be used to emit
301 /// data of the specified size to the specified numeric address space.
302 virtual const char *getDataASDirective(unsigned Size, unsigned AS) const {
303 assert(AS != 0 && "Don't know the directives for default addr space");
307 //===--- Alignment Information ----------------------------------------===//
309 /// AlignDirective - The directive used to emit round up to an alignment
312 const char *AlignDirective; // Defaults to "\t.align\t"
314 /// AlignmentIsInBytes - If this is true (the default) then the asmprinter
315 /// emits ".align N" directives, where N is the number of bytes to align to.
316 /// Otherwise, it emits ".align log2(N)", e.g. 3 to align to an 8 byte
318 bool AlignmentIsInBytes; // Defaults to true
320 /// TextAlignFillValue - If non-zero, this is used to fill the executable
321 /// space created as the result of a alignment directive.
322 unsigned TextAlignFillValue;
324 //===--- Section Switching Directives ---------------------------------===//
326 /// SwitchToSectionDirective - This is the directive used when we want to
327 /// emit a global to an arbitrary section. The section name is emited after
329 const char *SwitchToSectionDirective; // Defaults to "\t.section\t"
331 /// TextSectionStartSuffix - This is printed after each start of section
332 /// directive for text sections.
333 const char *TextSectionStartSuffix; // Defaults to "".
335 /// DataSectionStartSuffix - This is printed after each start of section
336 /// directive for data sections.
337 const char *DataSectionStartSuffix; // Defaults to "".
339 /// SectionEndDirectiveSuffix - If non-null, the asm printer will close each
340 /// section with the section name and this suffix printed.
341 const char *SectionEndDirectiveSuffix;// Defaults to null.
343 /// ConstantPoolSection - This is the section that we SwitchToSection right
344 /// before emitting the constant pool for a function.
345 const char *ConstantPoolSection; // Defaults to "\t.section .rodata"
347 /// JumpTableDataSection - This is the section that we SwitchToSection right
348 /// before emitting the jump tables for a function when the relocation model
350 const char *JumpTableDataSection; // Defaults to "\t.section .rodata"
352 /// JumpTableDirective - if non-null, the directive to emit before a jump
354 const char *JumpTableDirective;
356 /// CStringSection - If not null, this allows for special handling of
357 /// cstring constants (null terminated string that does not contain any
358 /// other null bytes) on this target. This is commonly supported as
360 const char *CStringSection; // Defaults to NULL
361 const Section *CStringSection_;
363 /// StaticCtorsSection - This is the directive that is emitted to switch to
364 /// a section to emit the static constructor list.
365 /// Defaults to "\t.section .ctors,\"aw\",@progbits".
366 const char *StaticCtorsSection;
368 /// StaticDtorsSection - This is the directive that is emitted to switch to
369 /// a section to emit the static destructor list.
370 /// Defaults to "\t.section .dtors,\"aw\",@progbits".
371 const char *StaticDtorsSection;
373 //===--- Global Variable Emission Directives --------------------------===//
375 /// GlobalDirective - This is the directive used to declare a global entity.
377 const char *GlobalDirective; // Defaults to NULL.
379 /// ExternDirective - This is the directive used to declare external
382 const char *ExternDirective; // Defaults to NULL.
384 /// SetDirective - This is the name of a directive that can be used to tell
385 /// the assembler to set the value of a variable to some expression.
386 const char *SetDirective; // Defaults to null.
388 /// LCOMMDirective - This is the name of a directive (if supported) that can
389 /// be used to efficiently declare a local (internal) block of zero
390 /// initialized data in the .bss/.data section. The syntax expected is:
391 /// @verbatim <LCOMMDirective> SYMBOLNAME LENGTHINBYTES, ALIGNMENT
393 const char *LCOMMDirective; // Defaults to null.
395 const char *COMMDirective; // Defaults to "\t.comm\t".
397 /// COMMDirectiveTakesAlignment - True if COMMDirective take a third
398 /// argument that specifies the alignment of the declaration.
399 bool COMMDirectiveTakesAlignment; // Defaults to true.
401 /// HasDotTypeDotSizeDirective - True if the target has .type and .size
402 /// directives, this is true for most ELF targets.
403 bool HasDotTypeDotSizeDirective; // Defaults to true.
405 /// HasSingleParameterDotFile - True if the target has a single parameter
406 /// .file directive, this is true for ELF targets.
407 bool HasSingleParameterDotFile; // Defaults to true.
409 /// UsedDirective - This directive, if non-null, is used to declare a global
410 /// as being used somehow that the assembler can't see. This prevents dead
411 /// code elimination on some targets.
412 const char *UsedDirective; // Defaults to null.
414 /// WeakRefDirective - This directive, if non-null, is used to declare a
415 /// global as being a weak undefined symbol.
416 const char *WeakRefDirective; // Defaults to null.
418 /// WeakDefDirective - This directive, if non-null, is used to declare a
419 /// global as being a weak defined symbol.
420 const char *WeakDefDirective; // Defaults to null.
422 /// HiddenDirective - This directive, if non-null, is used to declare a
423 /// global or function as having hidden visibility.
424 const char *HiddenDirective; // Defaults to "\t.hidden\t".
426 /// ProtectedDirective - This directive, if non-null, is used to declare a
427 /// global or function as having protected visibility.
428 const char *ProtectedDirective; // Defaults to "\t.protected\t".
430 //===--- Dwarf Emission Directives -----------------------------------===//
432 /// AbsoluteDebugSectionOffsets - True if we should emit abolute section
433 /// offsets for debug information. Defaults to false.
434 bool AbsoluteDebugSectionOffsets;
436 /// AbsoluteEHSectionOffsets - True if we should emit abolute section
437 /// offsets for EH information. Defaults to false.
438 bool AbsoluteEHSectionOffsets;
440 /// HasLEB128 - True if target asm supports leb128 directives.
442 bool HasLEB128; // Defaults to false.
444 /// hasDotLocAndDotFile - True if target asm supports .loc and .file
445 /// directives for emitting debugging information.
447 bool HasDotLocAndDotFile; // Defaults to false.
449 /// SupportsDebugInformation - True if target supports emission of debugging
451 bool SupportsDebugInformation;
453 /// SupportsExceptionHandling - True if target supports
454 /// exception handling.
456 bool SupportsExceptionHandling; // Defaults to false.
458 /// RequiresFrameSection - true if the Dwarf2 output needs a frame section
460 bool DwarfRequiresFrameSection; // Defaults to true.
462 /// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection is used to
463 /// encode inline subroutine information.
464 bool DwarfUsesInlineInfoSection; // Defaults to false.
466 /// Is_EHSymbolPrivate - If set, the "_foo.eh" is made private so that it
467 /// doesn't show up in the symbol table of the object file.
468 bool Is_EHSymbolPrivate; // Defaults to true.
470 /// GlobalEHDirective - This is the directive used to make exception frame
471 /// tables globally visible.
473 const char *GlobalEHDirective; // Defaults to NULL.
475 /// SupportsWeakEmptyEHFrame - True if target assembler and linker will
476 /// handle a weak_definition of constant 0 for an omitted EH frame.
477 bool SupportsWeakOmittedEHFrame; // Defaults to true.
479 /// DwarfSectionOffsetDirective - Special section offset directive.
480 const char* DwarfSectionOffsetDirective; // Defaults to NULL
482 /// DwarfAbbrevSection - Section directive for Dwarf abbrev.
484 const char *DwarfAbbrevSection; // Defaults to ".debug_abbrev".
486 /// DwarfInfoSection - Section directive for Dwarf info.
488 const char *DwarfInfoSection; // Defaults to ".debug_info".
490 /// DwarfLineSection - Section directive for Dwarf info.
492 const char *DwarfLineSection; // Defaults to ".debug_line".
494 /// DwarfFrameSection - Section directive for Dwarf info.
496 const char *DwarfFrameSection; // Defaults to ".debug_frame".
498 /// DwarfPubNamesSection - Section directive for Dwarf info.
500 const char *DwarfPubNamesSection; // Defaults to ".debug_pubnames".
502 /// DwarfPubTypesSection - Section directive for Dwarf info.
504 const char *DwarfPubTypesSection; // Defaults to ".debug_pubtypes".
506 /// DwarfDebugInlineSection - Section directive for inline info.
508 const char *DwarfDebugInlineSection; // Defaults to ".debug_inlined"
510 /// DwarfStrSection - Section directive for Dwarf info.
512 const char *DwarfStrSection; // Defaults to ".debug_str".
514 /// DwarfLocSection - Section directive for Dwarf info.
516 const char *DwarfLocSection; // Defaults to ".debug_loc".
518 /// DwarfARangesSection - Section directive for Dwarf info.
520 const char *DwarfARangesSection; // Defaults to ".debug_aranges".
522 /// DwarfRangesSection - Section directive for Dwarf info.
524 const char *DwarfRangesSection; // Defaults to ".debug_ranges".
526 /// DwarfMacroInfoSection - Section directive for DWARF macro info.
528 const char *DwarfMacroInfoSection; // Defaults to ".debug_macinfo".
530 /// DwarfEHFrameSection - Section directive for Exception frames.
532 const char *DwarfEHFrameSection; // Defaults to ".eh_frame".
534 /// DwarfExceptionSection - Section directive for Exception table.
536 const char *DwarfExceptionSection; // Defaults to ".gcc_except_table".
538 //===--- CBE Asm Translation Table -----------------------------------===//
540 const char *const *AsmTransCBE; // Defaults to empty
543 explicit TargetAsmInfo(const TargetMachine &TM);
544 virtual ~TargetAsmInfo();
546 const Section* getNamedSection(const char *Name,
547 unsigned Flags = SectionFlags::None,
548 bool Override = false) const;
549 const Section* getUnnamedSection(const char *Directive,
550 unsigned Flags = SectionFlags::None,
551 bool Override = false) const;
553 /// Measure the specified inline asm to determine an approximation of its
555 virtual unsigned getInlineAsmLength(const char *Str) const;
557 /// emitUsedDirectiveFor - This hook allows targets to selectively decide
558 /// not to emit the UsedDirective for some symbols in llvm.used.
559 // FIXME: REMOVE this (rdar://7071300)
560 virtual bool emitUsedDirectiveFor(const GlobalValue *GV,
561 Mangler *Mang) const {
565 /// PreferredEHDataFormat - This hook allows the target to select data
566 /// format used for encoding pointers in exception handling data. Reason is
567 /// 0 for data, 1 for code labels, 2 for function pointers. Global is true
568 /// if the symbol can be relocated.
569 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
573 /// getSectionForMergableConstant - Given a mergable constant with the
574 /// specified size and relocation information, return a section that it
575 /// should be placed in.
576 virtual const Section *
577 getSectionForMergableConstant(uint64_t Size, unsigned ReloInfo) const;
580 /// getSectionPrefixForUniqueGlobal - Return a string that we should prepend
581 /// onto a global's name in order to get the unique section name for the
582 /// global. This is important for globals that need to be merged across
583 /// translation units.
585 getSectionPrefixForUniqueGlobal(SectionKind::Kind Kind) const;
587 /// getFlagsForNamedSection - If this target wants to be able to infer
588 /// section flags based on the name of the section specified for a global
589 /// variable, it can implement this. This is used on ELF systems so that
590 /// ".tbss" gets the TLS bit set etc.
591 virtual unsigned getFlagsForNamedSection(const char *Section) const {
595 /// SectionForGlobal - This hooks returns proper section name for given
596 /// global with all necessary flags and marks.
597 // FIXME: MOVE TO TARGETLOWERING.
598 const Section* SectionForGlobal(const GlobalValue *GV) const;
600 /// getSpecialCasedSectionGlobals - Allow the target to completely override
601 /// section assignment of a global.
602 /// FIXME: ELIMINATE this by making PIC16 implement ADDRESS with
603 /// getFlagsForNamedSection.
604 virtual const Section *
605 getSpecialCasedSectionGlobals(const GlobalValue *GV,
606 SectionKind::Kind Kind) const{
610 const std::string &getSectionFlags(unsigned Flags) const;
611 virtual std::string printSectionFlags(unsigned flags) const { return ""; }
613 // FIXME: Eliminate this.
614 virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
615 SectionKind::Kind Kind) const;
617 /// getSLEB128Size - Compute the number of bytes required for a signed
619 static unsigned getSLEB128Size(int Value);
621 /// getULEB128Size - Compute the number of bytes required for an unsigned
623 static unsigned getULEB128Size(unsigned Value);
625 // Data directive accessors.
627 const char *getData8bitsDirective(unsigned AS = 0) const {
628 return AS == 0 ? Data8bitsDirective : getDataASDirective(8, AS);
630 const char *getData16bitsDirective(unsigned AS = 0) const {
631 return AS == 0 ? Data16bitsDirective : getDataASDirective(16, AS);
633 const char *getData32bitsDirective(unsigned AS = 0) const {
634 return AS == 0 ? Data32bitsDirective : getDataASDirective(32, AS);
636 const char *getData64bitsDirective(unsigned AS = 0) const {
637 return AS == 0 ? Data64bitsDirective : getDataASDirective(64, AS);
643 const Section *getTextSection() const {
646 const Section *getDataSection() const {
649 const char *getBSSSection() const {
652 const Section *getBSSSection_() const {
655 const Section *getReadOnlySection() const {
656 return ReadOnlySection;
658 const Section *getTLSDataSection() const {
659 return TLSDataSection;
661 const Section *getTLSBSSSection() const {
662 return TLSBSSSection;
664 const char *getZeroFillDirective() const {
665 return ZeroFillDirective;
667 const char *getNonexecutableStackDirective() const {
668 return NonexecutableStackDirective;
670 bool needsSet() const {
673 const char *getPCSymbol() const {
676 char getSeparatorChar() const {
677 return SeparatorChar;
679 unsigned getCommentColumn() const {
680 return CommentColumn;
682 const char *getCommentString() const {
683 return CommentString;
685 unsigned getOperandColumn(int operand) const {
686 return FirstOperandColumn + (MaxOperandLength+1)*(operand-1);
688 const char *getGlobalPrefix() const {
691 const char *getPrivateGlobalPrefix() const {
692 return PrivateGlobalPrefix;
694 const char *getLinkerPrivateGlobalPrefix() const {
695 return LinkerPrivateGlobalPrefix;
697 const char *getJumpTableSpecialLabelPrefix() const {
698 return JumpTableSpecialLabelPrefix;
700 const char *getGlobalVarAddrPrefix() const {
701 return GlobalVarAddrPrefix;
703 const char *getGlobalVarAddrSuffix() const {
704 return GlobalVarAddrSuffix;
706 const char *getFunctionAddrPrefix() const {
707 return FunctionAddrPrefix;
709 const char *getFunctionAddrSuffix() const {
710 return FunctionAddrSuffix;
712 const char *getPersonalityPrefix() const {
713 return PersonalityPrefix;
715 const char *getPersonalitySuffix() const {
716 return PersonalitySuffix;
718 bool getNeedsIndirectEncoding() const {
719 return NeedsIndirectEncoding;
721 const char *getInlineAsmStart() const {
722 return InlineAsmStart;
724 const char *getInlineAsmEnd() const {
727 unsigned getAssemblerDialect() const {
728 return AssemblerDialect;
730 bool doesAllowQuotesInName() const {
731 return AllowQuotesInName;
733 const char *getZeroDirective() const {
734 return ZeroDirective;
736 const char *getZeroDirectiveSuffix() const {
737 return ZeroDirectiveSuffix;
739 const char *getAsciiDirective() const {
740 return AsciiDirective;
742 const char *getAscizDirective() const {
743 return AscizDirective;
745 const char *getJumpTableDirective() const {
746 return JumpTableDirective;
748 const char *getAlignDirective() const {
749 return AlignDirective;
751 bool getAlignmentIsInBytes() const {
752 return AlignmentIsInBytes;
754 unsigned getTextAlignFillValue() const {
755 return TextAlignFillValue;
757 const char *getSwitchToSectionDirective() const {
758 return SwitchToSectionDirective;
760 const char *getTextSectionStartSuffix() const {
761 return TextSectionStartSuffix;
763 const char *getDataSectionStartSuffix() const {
764 return DataSectionStartSuffix;
766 const char *getSectionEndDirectiveSuffix() const {
767 return SectionEndDirectiveSuffix;
769 const char *getConstantPoolSection() const {
770 return ConstantPoolSection;
772 const char *getJumpTableDataSection() const {
773 return JumpTableDataSection;
775 const char *getCStringSection() const {
776 return CStringSection;
778 const Section *getCStringSection_() const {
779 return CStringSection_;
781 const char *getStaticCtorsSection() const {
782 return StaticCtorsSection;
784 const char *getStaticDtorsSection() const {
785 return StaticDtorsSection;
787 const char *getGlobalDirective() const {
788 return GlobalDirective;
790 const char *getExternDirective() const {
791 return ExternDirective;
793 const char *getSetDirective() const {
796 const char *getLCOMMDirective() const {
797 return LCOMMDirective;
799 const char *getCOMMDirective() const {
800 return COMMDirective;
802 bool getCOMMDirectiveTakesAlignment() const {
803 return COMMDirectiveTakesAlignment;
805 bool hasDotTypeDotSizeDirective() const {
806 return HasDotTypeDotSizeDirective;
808 bool hasSingleParameterDotFile() const {
809 return HasSingleParameterDotFile;
811 const char *getUsedDirective() const {
812 return UsedDirective;
814 const char *getWeakRefDirective() const {
815 return WeakRefDirective;
817 const char *getWeakDefDirective() const {
818 return WeakDefDirective;
820 const char *getHiddenDirective() const {
821 return HiddenDirective;
823 const char *getProtectedDirective() const {
824 return ProtectedDirective;
826 bool isAbsoluteDebugSectionOffsets() const {
827 return AbsoluteDebugSectionOffsets;
829 bool isAbsoluteEHSectionOffsets() const {
830 return AbsoluteEHSectionOffsets;
832 bool hasLEB128() const {
835 bool hasDotLocAndDotFile() const {
836 return HasDotLocAndDotFile;
838 bool doesSupportDebugInformation() const {
839 return SupportsDebugInformation;
841 bool doesSupportExceptionHandling() const {
842 return SupportsExceptionHandling;
844 bool doesDwarfRequireFrameSection() const {
845 return DwarfRequiresFrameSection;
847 bool doesDwarfUsesInlineInfoSection() const {
848 return DwarfUsesInlineInfoSection;
850 bool is_EHSymbolPrivate() const {
851 return Is_EHSymbolPrivate;
853 const char *getGlobalEHDirective() const {
854 return GlobalEHDirective;
856 bool getSupportsWeakOmittedEHFrame() const {
857 return SupportsWeakOmittedEHFrame;
859 const char *getDwarfSectionOffsetDirective() const {
860 return DwarfSectionOffsetDirective;
862 const char *getDwarfAbbrevSection() const {
863 return DwarfAbbrevSection;
865 const char *getDwarfInfoSection() const {
866 return DwarfInfoSection;
868 const char *getDwarfLineSection() const {
869 return DwarfLineSection;
871 const char *getDwarfFrameSection() const {
872 return DwarfFrameSection;
874 const char *getDwarfPubNamesSection() const {
875 return DwarfPubNamesSection;
877 const char *getDwarfPubTypesSection() const {
878 return DwarfPubTypesSection;
880 const char *getDwarfDebugInlineSection() const {
881 return DwarfDebugInlineSection;
883 const char *getDwarfStrSection() const {
884 return DwarfStrSection;
886 const char *getDwarfLocSection() const {
887 return DwarfLocSection;
889 const char *getDwarfARangesSection() const {
890 return DwarfARangesSection;
892 const char *getDwarfRangesSection() const {
893 return DwarfRangesSection;
895 const char *getDwarfMacroInfoSection() const {
896 return DwarfMacroInfoSection;
898 const char *getDwarfEHFrameSection() const {
899 return DwarfEHFrameSection;
901 const char *getDwarfExceptionSection() const {
902 return DwarfExceptionSection;
904 const char *const *getAsmCBE() const {