MCAsmInfo.h revision 39646d96e76aea5d20bffb386233a0dbb5932a21
1cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com//===-- llvm/MC/MCAsmInfo.h - Asm info --------------------------*- C++ -*-===//
2cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com//
3cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com//                     The LLVM Compiler Infrastructure
4cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com//
5cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com// This file is distributed under the University of Illinois Open Source
6cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com// License. See LICENSE.TXT for details.
7cf2cfa174ca878c144e17e9fc60ca8e9070d7dededisonn@google.com//
81be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com//===----------------------------------------------------------------------===//
91be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com//
10e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com// This file contains a class to be used as the basis for target specific
11eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com// asm writers.  This class primarily takes care of global printing constants,
12eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com// which are used in very similar ways across all targets.
13eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com//
14063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com//===----------------------------------------------------------------------===//
15063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
161be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com#ifndef LLVM_TARGET_ASM_INFO_H
171be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com#define LLVM_TARGET_ASM_INFO_H
181be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
19063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com#include "llvm/MC/MachineLocation.h"
20063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com#include "llvm/MC/MCDirectives.h"
21063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com#include <cassert>
22063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com#include <vector>
23063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
24063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.comnamespace llvm {
25063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com  class MCExpr;
26063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com  class MCSection;
27063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com  class MCStreamer;
28063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com  class MCSymbol;
29063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com  class MCContext;
30063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
31063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com  namespace ExceptionHandling {
32063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    enum ExceptionsType { None, DwarfCFI, SjLj, ARM, Win64 };
33063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com  }
34063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
35063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com  /// MCAsmInfo - This class is intended to be used as a base class for asm
36063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com  /// properties and features specific to the target.
37063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com  class MCAsmInfo {
38063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com  protected:
39063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    //===------------------------------------------------------------------===//
40063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    // Properties to be set by the target writer, used to configure asm printer.
41063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    //
42063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
43063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// PointerSize - Pointer size in bytes.
44063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    ///               Default is 4.
45063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    unsigned PointerSize;
46063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
47063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// IsLittleEndian - True if target is little endian.
48063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    ///                  Default is true.
49063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    bool IsLittleEndian;
50063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
51063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// StackGrowsUp - True if target stack grow up.
52063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    ///                Default is false.
53063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    bool StackGrowsUp;
54063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
55063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// HasSubsectionsViaSymbols - True if this target has the MachO
56063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// .subsections_via_symbols directive.
57063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    bool HasSubsectionsViaSymbols;           // Default is false.
58063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
59063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// HasMachoZeroFillDirective - True if this is a MachO target that supports
60063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// the macho-specific .zerofill directive for emitting BSS Symbols.
61063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    bool HasMachoZeroFillDirective;               // Default is false.
62063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
63063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// HasMachoTBSSDirective - True if this is a MachO target that supports
64063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// the macho-specific .tbss directive for emitting thread local BSS Symbols
65063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    bool HasMachoTBSSDirective;                 // Default is false.
66063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
67063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// HasStaticCtorDtorReferenceInStaticMode - True if the compiler should
68063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// emit a ".reference .constructors_used" or ".reference .destructors_used"
69063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// directive after the a static ctor/dtor list.  This directive is only
70063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// emitted in Static relocation model.
71063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    bool HasStaticCtorDtorReferenceInStaticMode;  // Default is false.
72063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
73063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// LinkerRequiresNonEmptyDwarfLines - True if the linker has a bug and
74063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// requires that the debug_line section be of a minimum size. In practice
75063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// such a linker requires a non empty line sequence if a file is present.
76063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    bool LinkerRequiresNonEmptyDwarfLines; // Default to false.
77063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
78063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// MaxInstLength - This is the maximum possible length of an instruction,
791be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// which is needed to compute the size of an inline asm.
801be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    unsigned MaxInstLength;                  // Defaults to 4.
811be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
821be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// PCSymbol - The symbol used to represent the current PC.  Used in PC
831be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// relative expressions.
84b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    const char *PCSymbol;                    // Defaults to "$".
85063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
86063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// SeparatorString - This string, if specified, is used to separate
87063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// instructions from each other when on the same line.
88063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    const char *SeparatorString;             // Defaults to ';'
89063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
90063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// CommentColumn - This indicates the comment num (zero-based) at
91063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// which asm comments should be printed.
92063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    unsigned CommentColumn;                  // Defaults to 40
93063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
94063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// CommentString - This indicates the comment character used by the
95063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// assembler.
96063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    const char *CommentString;               // Defaults to "#"
97b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com
98e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    /// LabelSuffix - This is appended to emitted labels.
99e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    const char *LabelSuffix;                 // Defaults to ":"
100b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com
101b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// GlobalPrefix - If this is set to a non-empty string, it is prepended
102b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// onto all global symbols.  This is often used for "_" or ".".
103b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    const char *GlobalPrefix;                // Defaults to ""
104b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com
105b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// PrivateGlobalPrefix - This prefix is used for globals like constant
106b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// pool entries that are completely private to the .s file and should not
107b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// have names in the .o file.  This is often "." or "L".
108b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    const char *PrivateGlobalPrefix;         // Defaults to "."
109b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com
110b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// LinkerPrivateGlobalPrefix - This prefix is used for symbols that should
111b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// be passed through the assembler but be removed by the linker.  This
112b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// is "l" on Darwin, currently used for some ObjC metadata.
113b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    const char *LinkerPrivateGlobalPrefix;   // Defaults to ""
114b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com
115b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// InlineAsmStart/End - If these are nonempty, they contain a directive to
116b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// emit before and after an inline assembly statement.
117b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    const char *InlineAsmStart;              // Defaults to "#APP\n"
118b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    const char *InlineAsmEnd;                // Defaults to "#NO_APP\n"
119b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com
120b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// Code16Directive, Code32Directive, Code64Directive - These are assembly
121b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    /// directives that tells the assembler to interpret the following
1221be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// instructions differently.
1231be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *Code16Directive;             // Defaults to ".code16"
1241be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *Code32Directive;             // Defaults to ".code32"
1251be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *Code64Directive;             // Defaults to ".code64"
1261be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
1271be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// AssemblerDialect - Which dialect of an assembler variant to use.
128063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    unsigned AssemblerDialect;               // Defaults to 0
1291be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
1301be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// AllowQuotesInName - This is true if the assembler allows for complex
131063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// symbol names to be surrounded in quotes.  This defaults to false.
1321be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool AllowQuotesInName;
133063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com
1341be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// AllowNameToStartWithDigit - This is true if the assembler allows symbol
1351be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// names to start with a digit (e.g., "0x0021").  This defaults to false.
1361be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool AllowNameToStartWithDigit;
1371be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
1381be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// AllowPeriodsInName - This is true if the assembler allows periods in
1391be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// symbol names.  This defaults to true.
1401be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool AllowPeriodsInName;
1411be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
1421be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// AllowUTF8 - This is true if the assembler accepts UTF-8 input.
1431be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    // FIXME: Make this a more general encoding setting?
1441be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool AllowUTF8;
1451be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
1461be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// UseDataRegionDirectives - This is true if data region markers should
1471be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// be printed as ".data_region/.end_data_region" directives. If false,
1481be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// use "$d/$a" labels instead.
1491be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool UseDataRegionDirectives;
1501be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
1511be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    //===--- Data Emission Directives -------------------------------------===//
1521be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
1531be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// ZeroDirective - this should be set to the directive used to get some
1541be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// number of zero bytes emitted to the current section.  Common cases are
155e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    /// "\t.zero\t" and "\t.space\t".  If this is set to null, the
156e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    /// Data*bitsDirective's will be used to emit zero bytes.
157e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    const char *ZeroDirective;               // Defaults to "\t.zero\t"
158eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com
1596e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    /// AsciiDirective - This directive allows emission of an ascii string with
160eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com    /// the standard C escape characters embedded into it.
161571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    const char *AsciiDirective;              // Defaults to "\t.ascii\t"
162eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com
163571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// AscizDirective - If not null, this allows for special handling of
1646e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    /// zero terminated strings on this target.  This is commonly supported as
165571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// ".asciz".  If a target doesn't support this, it can be set to null.
1666e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    const char *AscizDirective;              // Defaults to "\t.asciz\t"
1676e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com
168571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// DataDirectives - These directives are used to output some unit of
169eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com    /// integer data to the current section.  If a data directive is set to
1706e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    /// null, smaller data directives will be used to emit the large sizes.
171eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com    const char *Data8bitsDirective;          // Defaults to "\t.byte\t"
1722ccc3afa474f9485c39c2e863252ddaa3f35724bedisonn@google.com    const char *Data16bitsDirective;         // Defaults to "\t.short\t"
173571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    const char *Data32bitsDirective;         // Defaults to "\t.long\t"
174eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com    const char *Data64bitsDirective;         // Defaults to "\t.quad\t"
1753aac1f9f308192f3787265830fe86ce8874e7382edisonn@google.com
1763aac1f9f308192f3787265830fe86ce8874e7382edisonn@google.com    /// GPRel64Directive - if non-null, a directive that is used to emit a word
1772ccc3afa474f9485c39c2e863252ddaa3f35724bedisonn@google.com    /// which should be relocated as a 64-bit GP-relative offset, e.g. .gpdword
1783aac1f9f308192f3787265830fe86ce8874e7382edisonn@google.com    /// on Mips.
1793aac1f9f308192f3787265830fe86ce8874e7382edisonn@google.com    const char *GPRel64Directive;            // Defaults to NULL.
1806e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com
1816e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    /// GPRel32Directive - if non-null, a directive that is used to emit a word
1823aac1f9f308192f3787265830fe86ce8874e7382edisonn@google.com    /// which should be relocated as a 32-bit GP-relative offset, e.g. .gpword
1836e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    /// on Mips or .gprel32 on Alpha.
1846e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    const char *GPRel32Directive;            // Defaults to NULL.
185eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com
1866e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    /// getDataASDirective - Return the directive that should be used to emit
1876e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    /// data of the specified size to the specified numeric address space.
1886e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    virtual const char *getDataASDirective(unsigned Size, unsigned AS) const {
189eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com      assert(AS != 0 && "Don't know the directives for default addr space");
190eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com      return 0;
1916e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    }
1926e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com
1936e49c345b132ca55830c7dad746108cd3624eb8bedisonn@google.com    /// SunStyleELFSectionSwitchSyntax - This is true if this target uses "Sun
194eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com    /// Style" syntax for section switching ("#alloc,#write" etc) instead of the
195eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com    /// normal ELF syntax (,"a,w") in .section directives.
1963aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    bool SunStyleELFSectionSwitchSyntax;     // Defaults to false.
1971be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
1981be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// UsesELFSectionDirectiveForBSS - This is true if this target uses ELF
1991be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// '.section' directive before the '.bss' one. It's used for PPC/Linux
2001be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// which doesn't support the '.bss' directive only.
201eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com    bool UsesELFSectionDirectiveForBSS;      // Defaults to false.
202eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com
203571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// HasMicrosoftFastStdCallMangling - True if this target uses microsoft
2043aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    /// style mangling for functions with X86_StdCall/X86_FastCall calling
205b44334c1c07f307f3e2dbb9ee4ace4c14860a345edisonn@google.com    /// convention.
206571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    bool HasMicrosoftFastStdCallMangling;    // Defaults to false.
207571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
208571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    //===--- Alignment Information ----------------------------------------===//
209571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
210571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// AlignDirective - The directive used to emit round up to an alignment
211571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// boundary.
212571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    ///
213571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    const char *AlignDirective;              // Defaults to "\t.align\t"
214571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
215063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    /// AlignmentIsInBytes - If this is true (the default) then the asmprinter
216571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// emits ".align N" directives, where N is the number of bytes to align to.
217571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// Otherwise, it emits ".align log2(N)", e.g. 3 to align to an 8 byte
218571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// boundary.
219571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    bool AlignmentIsInBytes;                 // Defaults to true
220571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
221571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// TextAlignFillValue - If non-zero, this is used to fill the executable
222eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com    /// space created as the result of a alignment directive.
223eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com    unsigned TextAlignFillValue;             // Defaults to 0
224eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com
225eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com    //===--- Global Variable Emission Directives --------------------------===//
226eee4b65d0b91070946353fbac04327bd616d8932edisonn@google.com
2271be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// GlobalDirective - This is the directive used to declare a global entity.
2281be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    ///
2291be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *GlobalDirective;             // Defaults to NULL.
2303aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com
2313aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    /// ExternDirective - This is the directive used to declare external
232571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// globals.
233571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    ///
234e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    const char *ExternDirective;             // Defaults to NULL.
235571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
236571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// HasSetDirective - True if the assembler supports the .set directive.
2373aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    bool HasSetDirective;                    // Defaults to true.
238571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
2391be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// HasAggressiveSymbolFolding - False if the assembler requires that we use
2403aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    /// Lc = a - b
241571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// .long Lc
2421be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// instead of
2433aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    /// .long a - b
244571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    bool HasAggressiveSymbolFolding;           // Defaults to true.
2451be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
2463aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    /// COMMDirectiveAlignmentIsInBytes - True is .comm's and .lcomms optional
247571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// alignment is to be specified in bytes instead of log2(n).
2481be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool COMMDirectiveAlignmentIsInBytes;    // Defaults to true;
2493aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com
250571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// LCOMMDirectiveSupportsAlignment - True if .lcomm supports an optional
251571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// alignment argument on this target.
252571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    bool LCOMMDirectiveSupportsAlignment;    // Defaults to false.
253571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
254571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// HasDotTypeDotSizeDirective - True if the target has .type and .size
2551be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// directives, this is true for most ELF targets.
2561be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool HasDotTypeDotSizeDirective;         // Defaults to true.
2571be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
2583aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    /// HasSingleParameterDotFile - True if the target has a single parameter
259571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// .file directive, this is true for ELF targets.
260571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    bool HasSingleParameterDotFile;          // Defaults to true.
261571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
262571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// HasNoDeadStrip - True if this target supports the MachO .no_dead_strip
2633aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    /// directive.
2643aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    bool HasNoDeadStrip;                     // Defaults to false.
265571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
2663aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    /// HasSymbolResolver - True if this target supports the MachO
267571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// .symbol_resolver directive.
268571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    bool HasSymbolResolver;                     // Defaults to false.
269571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
270571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// WeakRefDirective - This directive, if non-null, is used to declare a
271e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    /// global as being a weak undefined symbol.
272e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    const char *WeakRefDirective;            // Defaults to NULL.
2731be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
2741be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// WeakDefDirective - This directive, if non-null, is used to declare a
2751be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// global as being a weak defined symbol.
2761be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *WeakDefDirective;            // Defaults to NULL.
277571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
2781be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// LinkOnceDirective - This directive, if non-null is used to declare a
2791be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// global as being a weak defined symbol.  This is used on cygwin/mingw.
280e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    const char *LinkOnceDirective;           // Defaults to NULL.
281e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com
2821be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// HiddenVisibilityAttr - This attribute, if not MCSA_Invalid, is used to
2831be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// declare a symbol as having hidden visibility.
2841be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    MCSymbolAttr HiddenVisibilityAttr;       // Defaults to MCSA_Hidden.
2851be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
286571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// HiddenDeclarationVisibilityAttr - This attribute, if not MCSA_Invalid,
2871be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// is used to declare an undefined symbol as having hidden visibility.
2881be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    MCSymbolAttr HiddenDeclarationVisibilityAttr;   // Defaults to MCSA_Hidden.
289e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com
290e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com
2911be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// ProtectedVisibilityAttr - This attribute, if not MCSA_Invalid, is used
2921be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// to declare a symbol as having protected visibility.
2931be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    MCSymbolAttr ProtectedVisibilityAttr;    // Defaults to MCSA_Protected
2941be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
295b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    //===--- Dwarf Emission Directives -----------------------------------===//
296b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com
297571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// HasLEB128 - True if target asm supports leb128 directives.
2981be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool HasLEB128;                          // Defaults to false.
2991be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
300e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    /// SupportsDebugInformation - True if target supports emission of debugging
301e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    /// information.
3021be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool SupportsDebugInformation;           // Defaults to false.
3031be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
3041be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// SupportsExceptionHandling - True if target supports exception handling.
3051be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    ExceptionHandling::ExceptionsType ExceptionsType; // Defaults to None
306571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com
3071be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection is used to
3081be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// encode inline subroutine information.
309e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    bool DwarfUsesInlineInfoSection;         // Defaults to false.
310e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com
3111be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// DwarfSectionOffsetDirective - Special section offset directive.
3121be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char* DwarfSectionOffsetDirective; // Defaults to NULL
3131be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
3141be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// DwarfUsesRelocationsAcrossSections - True if Dwarf2 output generally
315571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// uses relocations for references to other .debug_* sections.
3161be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool DwarfUsesRelocationsAcrossSections;
3171be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
3183aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    /// DwarfRegNumForCFI - True if dwarf register numbers are printed
319571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    /// instead of symbolic register names in .cfi_* directives.
3201be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool DwarfRegNumForCFI;  // Defaults to false;
321e878e726bd1c16a0d177543471e071c7338193f4edisonn@google.com
3223aac1f9f308192f3787265830fe86ce8874e7382edisonn@google.com    //===--- Prologue State ----------------------------------------------===//
3231be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
3241acab362fdde40948e47438edcc4326e04b9b52bedisonn@google.com    std::vector<MachineMove> InitialFrameState;
3251acab362fdde40948e47438edcc4326e04b9b52bedisonn@google.com
3261be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com  public:
3271be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    explicit MCAsmInfo();
328e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    virtual ~MCAsmInfo();
329e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com
330e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    // FIXME: move these methods to DwarfPrinter when the JIT stops using them.
331571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    static unsigned getSLEB128Size(int Value);
332d08d23b385d6bde45eab23123b0328e07f74201fcommit-bot@chromium.org    static unsigned getULEB128Size(unsigned Value);
3331be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
3341be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// getPointerSize - Get the pointer size in bytes.
3351be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    unsigned getPointerSize() const {
336b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com      return PointerSize;
3372ccc3afa474f9485c39c2e863252ddaa3f35724bedisonn@google.com    }
3382ccc3afa474f9485c39c2e863252ddaa3f35724bedisonn@google.com
3398272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com    /// islittleendian - True if the target is little endian.
3401be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool isLittleEndian() const {
3411be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com      return IsLittleEndian;
3421be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    }
3431be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
3441be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// isStackGrowthDirectionUp - True if target stack grow up.
3451be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool isStackGrowthDirectionUp() const {
3461be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com      return StackGrowsUp;
3471be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    }
3481be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
3491be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool hasSubsectionsViaSymbols() const { return HasSubsectionsViaSymbols; }
350e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com
3511be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    // Data directive accessors.
3521be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    //
3531be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *getData8bitsDirective(unsigned AS = 0) const {
3541be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com      return AS == 0 ? Data8bitsDirective : getDataASDirective(8, AS);
3558272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com    }
3561be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *getData16bitsDirective(unsigned AS = 0) const {
357571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com      return AS == 0 ? Data16bitsDirective : getDataASDirective(16, AS);
3588272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com    }
359e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    const char *getData32bitsDirective(unsigned AS = 0) const {
3608272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com      return AS == 0 ? Data32bitsDirective : getDataASDirective(32, AS);
3618272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com    }
3621be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *getData64bitsDirective(unsigned AS = 0) const {
363571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com      return AS == 0 ? Data64bitsDirective : getDataASDirective(64, AS);
3648272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com    }
365571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    const char *getGPRel64Directive() const { return GPRel64Directive; }
3661be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *getGPRel32Directive() const { return GPRel32Directive; }
3671be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
3681be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// getNonexecutableStackSection - Targets can implement this method to
3691be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// specify a section to switch to if the translation unit doesn't have any
3701be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    /// trampolines that require an executable stack.
3711be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    virtual const MCSection *getNonexecutableStackSection(MCContext &Ctx) const{
372571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com      return 0;
3738272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com    }
3748272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com
3758272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com    virtual const MCExpr *
376571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    getExprForPersonalitySymbol(const MCSymbol *Sym,
3778272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com                                unsigned Encoding,
378571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com                                MCStreamer &Streamer) const;
3791be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
3801be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const MCExpr *
3811be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    getExprForFDESymbol(const MCSymbol *Sym,
3821be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com                        unsigned Encoding,
3831be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com                        MCStreamer &Streamer) const;
3841be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
385571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    bool usesSunStyleELFSectionSwitchSyntax() const {
3868272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com      return SunStyleELFSectionSwitchSyntax;
3878272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com    }
3888272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com
389571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    bool usesELFSectionDirectiveForBSS() const {
3908272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com      return UsesELFSectionDirectiveForBSS;
391571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    }
3921be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com
3931be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool hasMicrosoftFastStdCallMangling() const {
3948272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com      return HasMicrosoftFastStdCallMangling;
395e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    }
3968272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com
3971be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    // Accessors.
398571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    //
399571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    bool hasMachoZeroFillDirective() const { return HasMachoZeroFillDirective; }
4008272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com    bool hasMachoTBSSDirective() const { return HasMachoTBSSDirective; }
401571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    bool hasStaticCtorDtorReferenceInStaticMode() const {
4021be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com      return HasStaticCtorDtorReferenceInStaticMode;
4031be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    }
4041be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    bool getLinkerRequiresNonEmptyDwarfLines() const {
4051be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com      return LinkerRequiresNonEmptyDwarfLines;
4061be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    }
4071be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    unsigned getMaxInstLength() const {
4081be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com      return MaxInstLength;
4091be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    }
4101be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *getPCSymbol() const {
411571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com      return PCSymbol;
4128272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com    }
413e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    const char *getSeparatorString() const {
414571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com      return SeparatorString;
4151be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    }
416571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    unsigned getCommentColumn() const {
4171be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com      return CommentColumn;
418e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com    }
4198272d87d3098c8e43feae5bd7bb2b4a7ab8f3337scroggo@google.com    const char *getCommentString() const {
4201be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com      return CommentString;
4211be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    }
4221be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *getLabelSuffix() const {
4231be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com      return LabelSuffix;
4241be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    }
4251be794fad6bef2b1ab98158bd3ad68dc4a52dbf6edisonn@google.com    const char *getGlobalPrefix() const {
426b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com      return GlobalPrefix;
4273aa355527a3b91d3e12b8bee49e5637d00a736caedisonn@google.com    }
428571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    const char *getPrivateGlobalPrefix() const {
429b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com      return PrivateGlobalPrefix;
430b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    }
431b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    const char *getLinkerPrivateGlobalPrefix() const {
432571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com      return LinkerPrivateGlobalPrefix;
433571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    }
434571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    const char *getInlineAsmStart() const {
435e50d9a1fcd9c4298079ff54f9a40c9708d30f8c6edisonn@google.com      return InlineAsmStart;
436b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    }
437b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    const char *getInlineAsmEnd() const {
438b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com      return InlineAsmEnd;
439b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    }
440b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    const char *getCode16Directive() const {
441b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com      return Code16Directive;
442b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    }
443571c70b95f56e22b5a7d6f4f288aa6c9a925a64fedisonn@google.com    const char *getCode32Directive() const {
444b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com      return Code32Directive;
445b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    }
446b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    const char *getCode64Directive() const {
447063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com      return Code64Directive;
448063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    }
449063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    unsigned getAssemblerDialect() const {
450063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com      return AssemblerDialect;
451b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    }
452b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    bool doesAllowQuotesInName() const {
453b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com      return AllowQuotesInName;
454b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    }
455b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    bool doesAllowNameToStartWithDigit() const {
456b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com      return AllowNameToStartWithDigit;
457063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    }
458063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    bool doesAllowPeriodsInName() const {
459063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com      return AllowPeriodsInName;
460063d7072ef45971c17045721626b3f0cd052b3b9edisonn@google.com    }
461b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    bool doesAllowUTF8() const {
462b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com      return AllowUTF8;
463b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    }
464b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    bool doesSupportDataRegionDirectives() const {
465b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com      return UseDataRegionDirectives;
466b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    }
467b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com    const char *getZeroDirective() const {
468b857a0c7de8cffb09281fa59591649fb1db6ad0aedisonn@google.com      return ZeroDirective;
469    }
470    const char *getAsciiDirective() const {
471      return AsciiDirective;
472    }
473    const char *getAscizDirective() const {
474      return AscizDirective;
475    }
476    const char *getAlignDirective() const {
477      return AlignDirective;
478    }
479    bool getAlignmentIsInBytes() const {
480      return AlignmentIsInBytes;
481    }
482    unsigned getTextAlignFillValue() const {
483      return TextAlignFillValue;
484    }
485    const char *getGlobalDirective() const {
486      return GlobalDirective;
487    }
488    const char *getExternDirective() const {
489      return ExternDirective;
490    }
491    bool hasSetDirective() const { return HasSetDirective; }
492    bool hasAggressiveSymbolFolding() const {
493      return HasAggressiveSymbolFolding;
494    }
495    bool getCOMMDirectiveAlignmentIsInBytes() const {
496      return COMMDirectiveAlignmentIsInBytes;
497    }
498    bool getLCOMMDirectiveSupportsAlignment() const {
499      return LCOMMDirectiveSupportsAlignment;
500    }
501    bool hasDotTypeDotSizeDirective() const {return HasDotTypeDotSizeDirective;}
502    bool hasSingleParameterDotFile() const { return HasSingleParameterDotFile; }
503    bool hasNoDeadStrip() const { return HasNoDeadStrip; }
504    bool hasSymbolResolver() const { return HasSymbolResolver; }
505    const char *getWeakRefDirective() const { return WeakRefDirective; }
506    const char *getWeakDefDirective() const { return WeakDefDirective; }
507    const char *getLinkOnceDirective() const { return LinkOnceDirective; }
508
509    MCSymbolAttr getHiddenVisibilityAttr() const { return HiddenVisibilityAttr;}
510    MCSymbolAttr getHiddenDeclarationVisibilityAttr() const {
511      return HiddenDeclarationVisibilityAttr;
512    }
513    MCSymbolAttr getProtectedVisibilityAttr() const {
514      return ProtectedVisibilityAttr;
515    }
516    bool hasLEB128() const {
517      return HasLEB128;
518    }
519    bool doesSupportDebugInformation() const {
520      return SupportsDebugInformation;
521    }
522    bool doesSupportExceptionHandling() const {
523      return ExceptionsType != ExceptionHandling::None;
524    }
525    ExceptionHandling::ExceptionsType getExceptionHandlingType() const {
526      return ExceptionsType;
527    }
528    bool isExceptionHandlingDwarf() const {
529      return
530        (ExceptionsType == ExceptionHandling::DwarfCFI ||
531         ExceptionsType == ExceptionHandling::ARM ||
532         ExceptionsType == ExceptionHandling::Win64);
533    }
534    bool doesDwarfUseInlineInfoSection() const {
535      return DwarfUsesInlineInfoSection;
536    }
537    const char *getDwarfSectionOffsetDirective() const {
538      return DwarfSectionOffsetDirective;
539    }
540    bool doesDwarfUseRelocationsAcrossSections() const {
541      return DwarfUsesRelocationsAcrossSections;
542    }
543    bool useDwarfRegNumForCFI() const {
544      return DwarfRegNumForCFI;
545    }
546
547    void addInitialFrameState(MCSymbol *label, const MachineLocation &D,
548                              const MachineLocation &S) {
549      InitialFrameState.push_back(MachineMove(label, D, S));
550    }
551    const std::vector<MachineMove> &getInitialFrameState() const {
552      return InitialFrameState;
553    }
554  };
555}
556
557#endif
558