MCAsmInfo.h revision 645aef1480384292b042c98ffe623a59ab0af049
182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner//===-- llvm/MC/MCAsmInfo.h - Asm info --------------------------*- C++ -*-===//
282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner//
382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner//                     The LLVM Compiler Infrastructure
482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner//
582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner// This file is distributed under the University of Illinois Open Source
682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner// License. See LICENSE.TXT for details.
782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner//
882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner//===----------------------------------------------------------------------===//
982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner//
1082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner// This file contains a class to be used as the basis for target specific
1182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner// asm writers.  This class primarily takes care of global printing constants,
1282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner// which are used in very similar ways across all targets.
1382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner//
1482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner//===----------------------------------------------------------------------===//
15af76e592c7f9deff0e55c13dbb4a34f07f1c7f64Chris Lattner
1682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner#ifndef LLVM_TARGET_ASM_INFO_H
1782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner#define LLVM_TARGET_ASM_INFO_H
18af76e592c7f9deff0e55c13dbb4a34f07f1c7f64Chris Lattner
19152a29bfa6fa505182658d046bc75626e10d67c3Chris Lattner#include "llvm/MC/MCDirectives.h"
2082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner#include <cassert>
2182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
2282d748d55c549dd055528ed10dbb534618ca8115Chris Lattnernamespace llvm {
23bfa27cc5d72e061a96efbb461864d40bc8089ec2Rafael Espindola  class MCExpr;
24f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner  class MCSection;
25bfa27cc5d72e061a96efbb461864d40bc8089ec2Rafael Espindola  class MCStreamer;
26bfa27cc5d72e061a96efbb461864d40bc8089ec2Rafael Espindola  class MCSymbol;
27f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner  class MCContext;
28f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
293965b5e974d57f3e56a2c7f37d76d73e572dfb20Anton Korobeynikov  namespace ExceptionHandling {
30d652b1368b1e381382951f450e5eeca870d91dd6Charles Davis    enum ExceptionsType { None, DwarfCFI, SjLj, ARM, Win64 };
313965b5e974d57f3e56a2c7f37d76d73e572dfb20Anton Korobeynikov  }
3282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
33d652b1368b1e381382951f450e5eeca870d91dd6Charles Davis  /// MCAsmInfo - This class is intended to be used as a base class for asm
34d652b1368b1e381382951f450e5eeca870d91dd6Charles Davis  /// properties and features specific to the target.
3582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner  class MCAsmInfo {
3682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner  protected:
3782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    //===------------------------------------------------------------------===//
3882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    // Properties to be set by the target writer, used to configure asm printer.
3982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    //
4082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
41f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner    /// HasSubsectionsViaSymbols - True if this target has the MachO
42f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner    /// .subsections_via_symbols directive.
43f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner    bool HasSubsectionsViaSymbols;           // Default is false.
44f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
45aac138e84dee1cb3ffc1035b2a1e4361fe0b4f80Chris Lattner    /// HasMachoZeroFillDirective - True if this is a MachO target that supports
46aac138e84dee1cb3ffc1035b2a1e4361fe0b4f80Chris Lattner    /// the macho-specific .zerofill directive for emitting BSS Symbols.
4771eae713153e564ec743c5c4162ff258c255de78Chris Lattner    bool HasMachoZeroFillDirective;               // Default is false.
48f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
4951f5d6af8c45bf145808ced9e867ac711acc9955Eric Christopher    /// HasMachoTBSSDirective - True if this is a MachO target that supports
5051f5d6af8c45bf145808ced9e867ac711acc9955Eric Christopher    /// the macho-specific .tbss directive for emitting thread local BSS Symbols
5151f5d6af8c45bf145808ced9e867ac711acc9955Eric Christopher    bool HasMachoTBSSDirective;                 // Default is false.
52f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
5371eae713153e564ec743c5c4162ff258c255de78Chris Lattner    /// HasStaticCtorDtorReferenceInStaticMode - True if the compiler should
5471eae713153e564ec743c5c4162ff258c255de78Chris Lattner    /// emit a ".reference .constructors_used" or ".reference .destructors_used"
5571eae713153e564ec743c5c4162ff258c255de78Chris Lattner    /// directive after the a static ctor/dtor list.  This directive is only
5671eae713153e564ec743c5c4162ff258c255de78Chris Lattner    /// emitted in Static relocation model.
5771eae713153e564ec743c5c4162ff258c255de78Chris Lattner    bool HasStaticCtorDtorReferenceInStaticMode;  // Default is false.
58f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
59767b1be3900bdc693aa0ad3e554ba034845f67f7Rafael Espindola    /// LinkerRequiresNonEmptyDwarfLines - True if the linker has a bug and
60767b1be3900bdc693aa0ad3e554ba034845f67f7Rafael Espindola    /// requires that the debug_line section be of a minimum size. In practice
61767b1be3900bdc693aa0ad3e554ba034845f67f7Rafael Espindola    /// such a linker requires a non empty line sequence if a file is present.
62767b1be3900bdc693aa0ad3e554ba034845f67f7Rafael Espindola    bool LinkerRequiresNonEmptyDwarfLines; // Default to false.
63767b1be3900bdc693aa0ad3e554ba034845f67f7Rafael Espindola
6482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// MaxInstLength - This is the maximum possible length of an instruction,
6582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// which is needed to compute the size of an inline asm.
66eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    unsigned MaxInstLength;                  // Defaults to 4.
67f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
6882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// PCSymbol - The symbol used to represent the current PC.  Used in PC
6982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// relative expressions.
70eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *PCSymbol;                    // Defaults to "$".
7182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
72d31d304f83f9c8df6870057509414b8d004bc8daJim Grosbach    /// SeparatorString - This string, if specified, is used to separate
73d31d304f83f9c8df6870057509414b8d004bc8daJim Grosbach    /// instructions from each other when on the same line.
74d31d304f83f9c8df6870057509414b8d004bc8daJim Grosbach    const char *SeparatorString;             // Defaults to ';'
7582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
7682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// CommentColumn - This indicates the comment num (zero-based) at
7782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// which asm comments should be printed.
7873163f875ad7e5d56aa7d0d29509eb1e04542742Daniel Dunbar    unsigned CommentColumn;                  // Defaults to 40
7982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
8082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// CommentString - This indicates the comment character used by the
8182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// assembler.
82eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *CommentString;               // Defaults to "#"
8382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
84e07b75e069969558c3fbb2f5bfb9a652f6ea1d6bChris Lattner    /// LabelSuffix - This is appended to emitted labels.
85e07b75e069969558c3fbb2f5bfb9a652f6ea1d6bChris Lattner    const char *LabelSuffix;                 // Defaults to ":"
86e07b75e069969558c3fbb2f5bfb9a652f6ea1d6bChris Lattner
8782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// GlobalPrefix - If this is set to a non-empty string, it is prepended
8882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// onto all global symbols.  This is often used for "_" or ".".
89eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *GlobalPrefix;                // Defaults to ""
9082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
9182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// PrivateGlobalPrefix - This prefix is used for globals like constant
9282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// pool entries that are completely private to the .s file and should not
9382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// have names in the .o file.  This is often "." or "L".
94eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *PrivateGlobalPrefix;         // Defaults to "."
95f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
9682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// LinkerPrivateGlobalPrefix - This prefix is used for symbols that should
9782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// be passed through the assembler but be removed by the linker.  This
9882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// is "l" on Darwin, currently used for some ObjC metadata.
99eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *LinkerPrivateGlobalPrefix;   // Defaults to ""
100f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
10182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// InlineAsmStart/End - If these are nonempty, they contain a directive to
10282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// emit before and after an inline assembly statement.
103eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *InlineAsmStart;              // Defaults to "#APP\n"
104eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *InlineAsmEnd;                // Defaults to "#NO_APP\n"
10582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
10682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// AssemblerDialect - Which dialect of an assembler variant to use.
107eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    unsigned AssemblerDialect;               // Defaults to 0
10882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
10982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// AllowQuotesInName - This is true if the assembler allows for complex
11082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// symbol names to be surrounded in quotes.  This defaults to false.
11182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    bool AllowQuotesInName;
112c6f729ed5519cdf398ca4039dbdbea4f81433ec0Anton Korobeynikov
113c6f729ed5519cdf398ca4039dbdbea4f81433ec0Anton Korobeynikov    /// AllowNameToStartWithDigit - This is true if the assembler allows symbol
114c6f729ed5519cdf398ca4039dbdbea4f81433ec0Anton Korobeynikov    /// names to start with a digit (e.g., "0x0021").  This defaults to false.
115c6f729ed5519cdf398ca4039dbdbea4f81433ec0Anton Korobeynikov    bool AllowNameToStartWithDigit;
116b9a01bcf486814a44098745920d43daaf9f7c260Mon P Wang
117b9a01bcf486814a44098745920d43daaf9f7c260Mon P Wang    /// AllowPeriodsInName - This is true if the assembler allows periods in
118b9a01bcf486814a44098745920d43daaf9f7c260Mon P Wang    /// symbol names.  This defaults to true.
119b9a01bcf486814a44098745920d43daaf9f7c260Mon P Wang    bool AllowPeriodsInName;
120b9a01bcf486814a44098745920d43daaf9f7c260Mon P Wang
12182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    //===--- Data Emission Directives -------------------------------------===//
12282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
12382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// ZeroDirective - this should be set to the directive used to get some
12482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// number of zero bytes emitted to the current section.  Common cases are
12582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// "\t.zero\t" and "\t.space\t".  If this is set to null, the
12682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// Data*bitsDirective's will be used to emit zero bytes.
127eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *ZeroDirective;               // Defaults to "\t.zero\t"
12882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
12982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// AsciiDirective - This directive allows emission of an ascii string with
13082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// the standard C escape characters embedded into it.
131eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *AsciiDirective;              // Defaults to "\t.ascii\t"
132f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
13382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// AscizDirective - If not null, this allows for special handling of
13482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// zero terminated strings on this target.  This is commonly supported as
13582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// ".asciz".  If a target doesn't support this, it can be set to null.
136eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *AscizDirective;              // Defaults to "\t.asciz\t"
13782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
13882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// DataDirectives - These directives are used to output some unit of
13982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// integer data to the current section.  If a data directive is set to
14082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// null, smaller data directives will be used to emit the large sizes.
141eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *Data8bitsDirective;          // Defaults to "\t.byte\t"
142eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *Data16bitsDirective;         // Defaults to "\t.short\t"
143eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *Data32bitsDirective;         // Defaults to "\t.long\t"
144eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *Data64bitsDirective;         // Defaults to "\t.quad\t"
14582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
14678f485afb723121eedf4b6907ae6eb53da8af03cChris Lattner    /// GPRel32Directive - if non-null, a directive that is used to emit a word
14778f485afb723121eedf4b6907ae6eb53da8af03cChris Lattner    /// which should be relocated as a 32-bit GP-relative offset, e.g. .gpword
14878f485afb723121eedf4b6907ae6eb53da8af03cChris Lattner    /// on Mips or .gprel32 on Alpha.
14978f485afb723121eedf4b6907ae6eb53da8af03cChris Lattner    const char *GPRel32Directive;            // Defaults to NULL.
150f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
15182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// getDataASDirective - Return the directive that should be used to emit
15282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// data of the specified size to the specified numeric address space.
15382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    virtual const char *getDataASDirective(unsigned Size, unsigned AS) const {
15482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      assert(AS != 0 && "Don't know the directives for default addr space");
1555ec2e6b586bf4029763711d6860b57d312eb2d2eChris Lattner      return 0;
15682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
15782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
15882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// SunStyleELFSectionSwitchSyntax - This is true if this target uses "Sun
15982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// Style" syntax for section switching ("#alloc,#write" etc) instead of the
16082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// normal ELF syntax (,"a,w") in .section directives.
161eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    bool SunStyleELFSectionSwitchSyntax;     // Defaults to false.
16282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
16382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// UsesELFSectionDirectiveForBSS - This is true if this target uses ELF
164f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach    /// '.section' directive before the '.bss' one. It's used for PPC/Linux
16582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// which doesn't support the '.bss' directive only.
166eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    bool UsesELFSectionDirectiveForBSS;      // Defaults to false.
167f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
1688a29fa6e02c8a76a71f43fc8bf4e51dd12bac4bcChris Lattner    /// HasMicrosoftFastStdCallMangling - True if this target uses microsoft
1698a29fa6e02c8a76a71f43fc8bf4e51dd12bac4bcChris Lattner    /// style mangling for functions with X86_StdCall/X86_FastCall calling
1708a29fa6e02c8a76a71f43fc8bf4e51dd12bac4bcChris Lattner    /// convention.
1718a29fa6e02c8a76a71f43fc8bf4e51dd12bac4bcChris Lattner    bool HasMicrosoftFastStdCallMangling;    // Defaults to false.
172f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
17382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    //===--- Alignment Information ----------------------------------------===//
17482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
17582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// AlignDirective - The directive used to emit round up to an alignment
17682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// boundary.
17782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    ///
178eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *AlignDirective;              // Defaults to "\t.align\t"
17982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
18082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// AlignmentIsInBytes - If this is true (the default) then the asmprinter
18182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// emits ".align N" directives, where N is the number of bytes to align to.
18282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// Otherwise, it emits ".align log2(N)", e.g. 3 to align to an 8 byte
18382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// boundary.
184eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    bool AlignmentIsInBytes;                 // Defaults to true
18582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
18682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// TextAlignFillValue - If non-zero, this is used to fill the executable
18782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// space created as the result of a alignment directive.
188eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    unsigned TextAlignFillValue;             // Defaults to 0
18982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
19082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    //===--- Global Variable Emission Directives --------------------------===//
191f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
19282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// GlobalDirective - This is the directive used to declare a global entity.
19382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    ///
194eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *GlobalDirective;             // Defaults to NULL.
19582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
196f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach    /// ExternDirective - This is the directive used to declare external
19782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// globals.
19882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    ///
199eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *ExternDirective;             // Defaults to NULL.
200f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
201cee63322eaccc2f1067bdf5eab506e440f867da1Chris Lattner    /// HasSetDirective - True if the assembler supports the .set directive.
202cee63322eaccc2f1067bdf5eab506e440f867da1Chris Lattner    bool HasSetDirective;                    // Defaults to true.
203f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
20490a5a0cd7c353651c953020b1e41b4c6e2f21883Rafael Espindola    /// HasAggressiveSymbolFolding - False if the assembler requires that we use
2055d4918dbd116b0b5e561c431b1ea527ee1b9302aRafael Espindola    /// Lc = a - b
2065d4918dbd116b0b5e561c431b1ea527ee1b9302aRafael Espindola    /// .long Lc
20790a5a0cd7c353651c953020b1e41b4c6e2f21883Rafael Espindola    /// instead of
2085d4918dbd116b0b5e561c431b1ea527ee1b9302aRafael Espindola    /// .long a - b
20990a5a0cd7c353651c953020b1e41b4c6e2f21883Rafael Espindola    bool HasAggressiveSymbolFolding;           // Defaults to true.
2105d4918dbd116b0b5e561c431b1ea527ee1b9302aRafael Espindola
2119eb158d5b4cd4f6fc80912e2dd77bdf13c3ca0e7Chris Lattner    /// HasLCOMMDirective - This is true if the target supports the .lcomm
2129eb158d5b4cd4f6fc80912e2dd77bdf13c3ca0e7Chris Lattner    /// directive.
213cee63322eaccc2f1067bdf5eab506e440f867da1Chris Lattner    bool HasLCOMMDirective;                  // Defaults to false.
214f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
2152e2563bf8e0f0a7f8c923000c0206855f16968b2Rafael Espindola    /// COMMDirectiveAlignmentIsInBytes - True is COMMDirective's optional
2162e2563bf8e0f0a7f8c923000c0206855f16968b2Rafael Espindola    /// alignment is to be specified in bytes instead of log2(n).
2172e2563bf8e0f0a7f8c923000c0206855f16968b2Rafael Espindola    bool COMMDirectiveAlignmentIsInBytes;    // Defaults to true;
218f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
21982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// HasDotTypeDotSizeDirective - True if the target has .type and .size
22082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// directives, this is true for most ELF targets.
221eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    bool HasDotTypeDotSizeDirective;         // Defaults to true.
22282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
22382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// HasSingleParameterDotFile - True if the target has a single parameter
22482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// .file directive, this is true for ELF targets.
225eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    bool HasSingleParameterDotFile;          // Defaults to true.
22682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
2273a9be0ee36fe2143f514d28315f3dc1bda132b2eChris Lattner    /// HasNoDeadStrip - True if this target supports the MachO .no_dead_strip
2283a9be0ee36fe2143f514d28315f3dc1bda132b2eChris Lattner    /// directive.
2293a9be0ee36fe2143f514d28315f3dc1bda132b2eChris Lattner    bool HasNoDeadStrip;                     // Defaults to false.
23082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
231e8e98d7f2eaa0613442ce21ab6a040c0f04f5b4dKevin Enderby    /// HasSymbolResolver - True if this target supports the MachO
232e8e98d7f2eaa0613442ce21ab6a040c0f04f5b4dKevin Enderby    /// .symbol_resolver directive.
233e8e98d7f2eaa0613442ce21ab6a040c0f04f5b4dKevin Enderby    bool HasSymbolResolver;                     // Defaults to false.
234e8e98d7f2eaa0613442ce21ab6a040c0f04f5b4dKevin Enderby
23582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// WeakRefDirective - This directive, if non-null, is used to declare a
23682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// global as being a weak undefined symbol.
237eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *WeakRefDirective;            // Defaults to NULL.
238f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
23982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// WeakDefDirective - This directive, if non-null, is used to declare a
24082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// global as being a weak defined symbol.
241eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *WeakDefDirective;            // Defaults to NULL.
24241eb8b47717e1fe1a6d0e99ec1b4e890091f77aaChris Lattner
24341eb8b47717e1fe1a6d0e99ec1b4e890091f77aaChris Lattner    /// LinkOnceDirective - This directive, if non-null is used to declare a
24441eb8b47717e1fe1a6d0e99ec1b4e890091f77aaChris Lattner    /// global as being a weak defined symbol.  This is used on cygwin/mingw.
24541eb8b47717e1fe1a6d0e99ec1b4e890091f77aaChris Lattner    const char *LinkOnceDirective;           // Defaults to NULL.
246f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
247152a29bfa6fa505182658d046bc75626e10d67c3Chris Lattner    /// HiddenVisibilityAttr - This attribute, if not MCSA_Invalid, is used to
248152a29bfa6fa505182658d046bc75626e10d67c3Chris Lattner    /// declare a symbol as having hidden visibility.
249152a29bfa6fa505182658d046bc75626e10d67c3Chris Lattner    MCSymbolAttr HiddenVisibilityAttr;       // Defaults to MCSA_Hidden.
25082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
2515129bdecd87c518713765acd6998c80f9eef36a2Stuart Hastings    /// HiddenDeclarationVisibilityAttr - This attribute, if not MCSA_Invalid,
2525129bdecd87c518713765acd6998c80f9eef36a2Stuart Hastings    /// is used to declare an undefined symbol as having hidden visibility.
2535129bdecd87c518713765acd6998c80f9eef36a2Stuart Hastings    MCSymbolAttr HiddenDeclarationVisibilityAttr;   // Defaults to MCSA_Hidden.
2545129bdecd87c518713765acd6998c80f9eef36a2Stuart Hastings
2555129bdecd87c518713765acd6998c80f9eef36a2Stuart Hastings
256152a29bfa6fa505182658d046bc75626e10d67c3Chris Lattner    /// ProtectedVisibilityAttr - This attribute, if not MCSA_Invalid, is used
257152a29bfa6fa505182658d046bc75626e10d67c3Chris Lattner    /// to declare a symbol as having protected visibility.
258152a29bfa6fa505182658d046bc75626e10d67c3Chris Lattner    MCSymbolAttr ProtectedVisibilityAttr;    // Defaults to MCSA_Protected
25982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
26082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    //===--- Dwarf Emission Directives -----------------------------------===//
26182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
26282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// HasLEB128 - True if target asm supports leb128 directives.
263b9e7689c89acf9324fba9242e00a9a4b8a3a83a6Bill Wendling    bool HasLEB128;                          // Defaults to false.
26482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
26582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// SupportsDebugInformation - True if target supports emission of debugging
26682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// information.
267b9e7689c89acf9324fba9242e00a9a4b8a3a83a6Bill Wendling    bool SupportsDebugInformation;           // Defaults to false.
26882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
269b9e7689c89acf9324fba9242e00a9a4b8a3a83a6Bill Wendling    /// SupportsExceptionHandling - True if target supports exception handling.
270b9e7689c89acf9324fba9242e00a9a4b8a3a83a6Bill Wendling    ExceptionHandling::ExceptionsType ExceptionsType; // Defaults to None
27182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
27282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection is used to
27382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// encode inline subroutine information.
274b9e7689c89acf9324fba9242e00a9a4b8a3a83a6Bill Wendling    bool DwarfUsesInlineInfoSection;         // Defaults to false.
27582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
27682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    /// DwarfSectionOffsetDirective - Special section offset directive.
27782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char* DwarfSectionOffsetDirective; // Defaults to NULL
278f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
279dc52ecf6fdbee63652d2dac0dccc17e23ac7797fRafael Espindola    /// DwarfRequiresRelocationForSectionOffset - True if we need to produce a
280dc52ecf6fdbee63652d2dac0dccc17e23ac7797fRafael Espindola    // relocation when we want a section offset in dwarf.
281dc52ecf6fdbee63652d2dac0dccc17e23ac7797fRafael Espindola    bool DwarfRequiresRelocationForSectionOffset;  // Defaults to true;
282ae84d5b9bafd1ba88aa12e8398e5385f229fa306Devang Patel
283b1fcfbe89bd155fb88485b2a3a995adba3994003Devang Patel    // DwarfUsesLabelOffsetDifference - True if Dwarf2 output can
284b1fcfbe89bd155fb88485b2a3a995adba3994003Devang Patel    // use EmitLabelOffsetDifference.
285b1fcfbe89bd155fb88485b2a3a995adba3994003Devang Patel    bool DwarfUsesLabelOffsetForRanges;
286b1fcfbe89bd155fb88485b2a3a995adba3994003Devang Patel
28782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    //===--- CBE Asm Translation Table -----------------------------------===//
28882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
289eb2fde2c939892f620de93f56dc21ec0c36824efBill Wendling    const char *const *AsmTransCBE;          // Defaults to empty
29082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
29182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner  public:
2928eeba35babf3114966fc4e6e8522057e46b610dbChris Lattner    explicit MCAsmInfo();
29382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    virtual ~MCAsmInfo();
29482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
295f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner    // FIXME: move these methods to DwarfPrinter when the JIT stops using them.
29682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    static unsigned getSLEB128Size(int Value);
29782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    static unsigned getULEB128Size(unsigned Value);
29882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
299f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner    bool hasSubsectionsViaSymbols() const { return HasSubsectionsViaSymbols; }
300f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
30182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    // Data directive accessors.
30282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    //
30382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getData8bitsDirective(unsigned AS = 0) const {
30482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return AS == 0 ? Data8bitsDirective : getDataASDirective(8, AS);
30582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
30682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getData16bitsDirective(unsigned AS = 0) const {
30782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return AS == 0 ? Data16bitsDirective : getDataASDirective(16, AS);
30882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
30982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getData32bitsDirective(unsigned AS = 0) const {
31082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return AS == 0 ? Data32bitsDirective : getDataASDirective(32, AS);
31182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
31282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getData64bitsDirective(unsigned AS = 0) const {
31382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return AS == 0 ? Data64bitsDirective : getDataASDirective(64, AS);
31482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
31578f485afb723121eedf4b6907ae6eb53da8af03cChris Lattner    const char *getGPRel32Directive() const { return GPRel32Directive; }
31682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
317f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner    /// getNonexecutableStackSection - Targets can implement this method to
318f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner    /// specify a section to switch to if the translation unit doesn't have any
319f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner    /// trampolines that require an executable stack.
32074aae4726a66733c5872588287535a984f9a94c7Chris Lattner    virtual const MCSection *getNonexecutableStackSection(MCContext &Ctx) const{
321f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner      return 0;
322f9f93e4388962b678fd59b7af5212d4cc0d38be2Chris Lattner    }
323f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
324bfa27cc5d72e061a96efbb461864d40bc8089ec2Rafael Espindola    virtual const MCExpr *
325bfa27cc5d72e061a96efbb461864d40bc8089ec2Rafael Espindola    getExprForPersonalitySymbol(const MCSymbol *Sym,
326debd7e4e8bc5cfe61bfb71835ce2b1a3fbccc2beRafael Espindola                                unsigned Encoding,
327bfa27cc5d72e061a96efbb461864d40bc8089ec2Rafael Espindola                                MCStreamer &Streamer) const;
328bfa27cc5d72e061a96efbb461864d40bc8089ec2Rafael Espindola
329debd7e4e8bc5cfe61bfb71835ce2b1a3fbccc2beRafael Espindola    const MCExpr *
330debd7e4e8bc5cfe61bfb71835ce2b1a3fbccc2beRafael Espindola    getExprForFDESymbol(const MCSymbol *Sym,
331debd7e4e8bc5cfe61bfb71835ce2b1a3fbccc2beRafael Espindola                        unsigned Encoding,
332debd7e4e8bc5cfe61bfb71835ce2b1a3fbccc2beRafael Espindola                        MCStreamer &Streamer) const;
333a0057ca13f06b8de08483c3e3a143a7236c67097Rafael Espindola
33482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    bool usesSunStyleELFSectionSwitchSyntax() const {
33582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return SunStyleELFSectionSwitchSyntax;
33682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
337f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
33882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    bool usesELFSectionDirectiveForBSS() const {
33982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return UsesELFSectionDirectiveForBSS;
34082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
34182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
3428a29fa6e02c8a76a71f43fc8bf4e51dd12bac4bcChris Lattner    bool hasMicrosoftFastStdCallMangling() const {
3438a29fa6e02c8a76a71f43fc8bf4e51dd12bac4bcChris Lattner      return HasMicrosoftFastStdCallMangling;
3448a29fa6e02c8a76a71f43fc8bf4e51dd12bac4bcChris Lattner    }
345f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
34682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    // Accessors.
34782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    //
348aac138e84dee1cb3ffc1035b2a1e4361fe0b4f80Chris Lattner    bool hasMachoZeroFillDirective() const { return HasMachoZeroFillDirective; }
349c1a887d76d95100e7e05aa76e077710bc4e0b1cfEric Christopher    bool hasMachoTBSSDirective() const { return HasMachoTBSSDirective; }
35071eae713153e564ec743c5c4162ff258c255de78Chris Lattner    bool hasStaticCtorDtorReferenceInStaticMode() const {
35171eae713153e564ec743c5c4162ff258c255de78Chris Lattner      return HasStaticCtorDtorReferenceInStaticMode;
35271eae713153e564ec743c5c4162ff258c255de78Chris Lattner    }
353767b1be3900bdc693aa0ad3e554ba034845f67f7Rafael Espindola    bool getLinkerRequiresNonEmptyDwarfLines() const {
354767b1be3900bdc693aa0ad3e554ba034845f67f7Rafael Espindola      return LinkerRequiresNonEmptyDwarfLines;
355767b1be3900bdc693aa0ad3e554ba034845f67f7Rafael Espindola    }
35682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    unsigned getMaxInstLength() const {
35782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return MaxInstLength;
35882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
35982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getPCSymbol() const {
36082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return PCSymbol;
36182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
362d31d304f83f9c8df6870057509414b8d004bc8daJim Grosbach    const char *getSeparatorString() const {
363d31d304f83f9c8df6870057509414b8d004bc8daJim Grosbach      return SeparatorString;
36482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
36582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    unsigned getCommentColumn() const {
36682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return CommentColumn;
36782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
36882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getCommentString() const {
36982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return CommentString;
37082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
371e07b75e069969558c3fbb2f5bfb9a652f6ea1d6bChris Lattner    const char *getLabelSuffix() const {
372e07b75e069969558c3fbb2f5bfb9a652f6ea1d6bChris Lattner      return LabelSuffix;
373e07b75e069969558c3fbb2f5bfb9a652f6ea1d6bChris Lattner    }
37482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getGlobalPrefix() const {
37582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return GlobalPrefix;
37682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
37782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getPrivateGlobalPrefix() const {
37882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return PrivateGlobalPrefix;
37982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
38082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getLinkerPrivateGlobalPrefix() const {
38182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return LinkerPrivateGlobalPrefix;
38282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
38382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getInlineAsmStart() const {
38482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return InlineAsmStart;
38582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
38682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getInlineAsmEnd() const {
38782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return InlineAsmEnd;
38882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
38982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    unsigned getAssemblerDialect() const {
39082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return AssemblerDialect;
39182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
39282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    bool doesAllowQuotesInName() const {
39382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return AllowQuotesInName;
39482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
395c6f729ed5519cdf398ca4039dbdbea4f81433ec0Anton Korobeynikov    bool doesAllowNameToStartWithDigit() const {
396c6f729ed5519cdf398ca4039dbdbea4f81433ec0Anton Korobeynikov      return AllowNameToStartWithDigit;
397c6f729ed5519cdf398ca4039dbdbea4f81433ec0Anton Korobeynikov    }
398b9a01bcf486814a44098745920d43daaf9f7c260Mon P Wang    bool doesAllowPeriodsInName() const {
399b9a01bcf486814a44098745920d43daaf9f7c260Mon P Wang      return AllowPeriodsInName;
400b9a01bcf486814a44098745920d43daaf9f7c260Mon P Wang    }
40182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getZeroDirective() const {
40282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return ZeroDirective;
40382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
40482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getAsciiDirective() const {
40582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return AsciiDirective;
40682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
40782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getAscizDirective() const {
40882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return AscizDirective;
40982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
41082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getAlignDirective() const {
41182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return AlignDirective;
41282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
41382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    bool getAlignmentIsInBytes() const {
41482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return AlignmentIsInBytes;
41582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
41682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    unsigned getTextAlignFillValue() const {
41782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return TextAlignFillValue;
41882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
41982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getGlobalDirective() const {
42082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return GlobalDirective;
42182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
42282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getExternDirective() const {
42382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return ExternDirective;
42482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
425cee63322eaccc2f1067bdf5eab506e440f867da1Chris Lattner    bool hasSetDirective() const { return HasSetDirective; }
42690a5a0cd7c353651c953020b1e41b4c6e2f21883Rafael Espindola    bool hasAggressiveSymbolFolding() const {
42790a5a0cd7c353651c953020b1e41b4c6e2f21883Rafael Espindola      return HasAggressiveSymbolFolding;
42890a5a0cd7c353651c953020b1e41b4c6e2f21883Rafael Espindola    }
4299eb158d5b4cd4f6fc80912e2dd77bdf13c3ca0e7Chris Lattner    bool hasLCOMMDirective() const { return HasLCOMMDirective; }
4303a9be0ee36fe2143f514d28315f3dc1bda132b2eChris Lattner    bool hasDotTypeDotSizeDirective() const {return HasDotTypeDotSizeDirective;}
4312e2563bf8e0f0a7f8c923000c0206855f16968b2Rafael Espindola    bool getCOMMDirectiveAlignmentIsInBytes() const {
4322e2563bf8e0f0a7f8c923000c0206855f16968b2Rafael Espindola      return COMMDirectiveAlignmentIsInBytes;
4332e2563bf8e0f0a7f8c923000c0206855f16968b2Rafael Espindola    }
4343a9be0ee36fe2143f514d28315f3dc1bda132b2eChris Lattner    bool hasSingleParameterDotFile() const { return HasSingleParameterDotFile; }
4353a9be0ee36fe2143f514d28315f3dc1bda132b2eChris Lattner    bool hasNoDeadStrip() const { return HasNoDeadStrip; }
436e8e98d7f2eaa0613442ce21ab6a040c0f04f5b4dKevin Enderby    bool hasSymbolResolver() const { return HasSymbolResolver; }
43741eb8b47717e1fe1a6d0e99ec1b4e890091f77aaChris Lattner    const char *getWeakRefDirective() const { return WeakRefDirective; }
43841eb8b47717e1fe1a6d0e99ec1b4e890091f77aaChris Lattner    const char *getWeakDefDirective() const { return WeakDefDirective; }
43941eb8b47717e1fe1a6d0e99ec1b4e890091f77aaChris Lattner    const char *getLinkOnceDirective() const { return LinkOnceDirective; }
440f10dfa910def9cdca566edbd6d2089b075a57b21Jim Grosbach
441152a29bfa6fa505182658d046bc75626e10d67c3Chris Lattner    MCSymbolAttr getHiddenVisibilityAttr() const { return HiddenVisibilityAttr;}
4425129bdecd87c518713765acd6998c80f9eef36a2Stuart Hastings    MCSymbolAttr getHiddenDeclarationVisibilityAttr() const {
4435129bdecd87c518713765acd6998c80f9eef36a2Stuart Hastings      return HiddenDeclarationVisibilityAttr;
4445129bdecd87c518713765acd6998c80f9eef36a2Stuart Hastings    }
445152a29bfa6fa505182658d046bc75626e10d67c3Chris Lattner    MCSymbolAttr getProtectedVisibilityAttr() const {
446152a29bfa6fa505182658d046bc75626e10d67c3Chris Lattner      return ProtectedVisibilityAttr;
44782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
44882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    bool hasLEB128() const {
44982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return HasLEB128;
45082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
45182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    bool doesSupportDebugInformation() const {
45282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return SupportsDebugInformation;
45382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
45482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    bool doesSupportExceptionHandling() const {
45582d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return ExceptionsType != ExceptionHandling::None;
45682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
45782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    ExceptionHandling::ExceptionsType getExceptionHandlingType() const {
45882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return ExceptionsType;
45982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
4603965b5e974d57f3e56a2c7f37d76d73e572dfb20Anton Korobeynikov    bool isExceptionHandlingDwarf() const {
4613965b5e974d57f3e56a2c7f37d76d73e572dfb20Anton Korobeynikov      return
462254784f9e0ae59fc060ccd54b39cd1e94ac91356Rafael Espindola        (ExceptionsType == ExceptionHandling::DwarfCFI ||
463645aef1480384292b042c98ffe623a59ab0af049Charles Davis         ExceptionsType == ExceptionHandling::ARM ||
464645aef1480384292b042c98ffe623a59ab0af049Charles Davis         ExceptionsType == ExceptionHandling::Win64);
4653965b5e974d57f3e56a2c7f37d76d73e572dfb20Anton Korobeynikov    }
46682d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    bool doesDwarfUsesInlineInfoSection() const {
46782d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return DwarfUsesInlineInfoSection;
46882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
46982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *getDwarfSectionOffsetDirective() const {
47082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return DwarfSectionOffsetDirective;
47182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
472dc52ecf6fdbee63652d2dac0dccc17e23ac7797fRafael Espindola    bool doesDwarfRequireRelocationForSectionOffset() const {
473dc52ecf6fdbee63652d2dac0dccc17e23ac7797fRafael Espindola      return DwarfRequiresRelocationForSectionOffset;
474ae84d5b9bafd1ba88aa12e8398e5385f229fa306Devang Patel    }
475b1fcfbe89bd155fb88485b2a3a995adba3994003Devang Patel    bool doesDwarfUsesLabelOffsetForRanges() const {
476b1fcfbe89bd155fb88485b2a3a995adba3994003Devang Patel      return DwarfUsesLabelOffsetForRanges;
477b1fcfbe89bd155fb88485b2a3a995adba3994003Devang Patel    }
47882d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    const char *const *getAsmCBE() const {
47982d748d55c549dd055528ed10dbb534618ca8115Chris Lattner      return AsmTransCBE;
48082d748d55c549dd055528ed10dbb534618ca8115Chris Lattner    }
48182d748d55c549dd055528ed10dbb534618ca8115Chris Lattner  };
48282d748d55c549dd055528ed10dbb534618ca8115Chris Lattner}
48382d748d55c549dd055528ed10dbb534618ca8115Chris Lattner
48482d748d55c549dd055528ed10dbb534618ca8115Chris Lattner#endif
485