Simplify some getNode calls.
[oota-llvm.git] / include / llvm / Target / TargetAsmInfo.h
index 4e6d3b991ced2fb8fbbd65fd9034a48da2c63030..9b5ba4819cb9408041fef3744aa9abd58734fe16 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by James M. Laskey and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
+  // DWARF encoding query type
+  namespace DwarfEncoding {
+    enum Target {
+      Data       = 0,
+      CodeLabels = 1,
+      Functions  = 2
+    };
+  }
+
   class TargetMachine;
   class CallInst;
 
@@ -52,16 +61,25 @@ namespace llvm {
     /// Null if this target doesn't support a BSS section.
     ///
     const char *TLSBSSSection;// Default to ".section .tbss,"awT",@nobits".
+
     /// ZeroFillDirective - Directive for emitting a global to the ZeroFill
     /// section on this target.  Null if this target doesn't support zerofill.
     const char *ZeroFillDirective;        // Default is null.
     
-    /// AddressSize - Size of addresses used in file.
-    ///
-    unsigned AddressSize;                 // Defaults to 4.
-    
-    /// NeedsSet - True if target asm can't compute addresses on data
-    /// directives.
+    /// NonexecutableStackDirective - Directive for declaring to the
+    /// linker and beyond that the emitted code does not require stack
+    /// memory to be executable.
+    const char *NonexecutableStackDirective; // Default is null.
+
+    /// NeedsSet - True if target asm treats expressions in data directives
+    /// as linktime-relocatable.  For assembly-time computation, we need to
+    /// use a .set.  Thus:
+    /// .set w, x-y
+    /// .long w
+    /// is computed at assembly time, while
+    /// .long x-y
+    /// is relocated if the relative locations of x and y change at linktime.
+    /// We want both these things in different places.
     bool NeedsSet;                        // Defaults to false.
     
     /// MaxInstLength - This is the maximum possible length of an instruction,
@@ -104,12 +122,23 @@ namespace llvm {
     /// will enclose any GlobalVariable that points to a function.
     /// For example, this is used by the IA64 backend to materialize
     /// function descriptors, by decorating the ".data8" object with the
-    /// \literal @fptr( ) \endliteral
+    /// @verbatim @fptr( ) @endverbatim
     /// link-relocation operator.
     ///
     const char *FunctionAddrPrefix;       // Defaults to ""
     const char *FunctionAddrSuffix;       // Defaults to ""
 
+    /// PersonalityPrefix/Suffix - If these are nonempty, these strings will
+    /// enclose any personality function in the common frame section.
+    /// 
+    const char *PersonalityPrefix;        // Defaults to ""
+    const char *PersonalitySuffix;        // Defaults to ""
+
+    /// NeedsIndirectEncoding - If set, we need to set the indirect encoding bit
+    /// for EH in Dwarf.
+    /// 
+    bool NeedsIndirectEncoding;           // Defaults to false
+
     /// InlineAsmStart/End - If these are nonempty, they contain a directive to
     /// emit before and after an inline assembly statement.
     const char *InlineAsmStart;           // Defaults to "#APP\n"
@@ -118,6 +147,12 @@ namespace llvm {
     /// AssemblerDialect - Which dialect of an assembler variant to use.
     unsigned AssemblerDialect;            // Defaults to 0
 
+    /// StringConstantPrefix - Prefix for FEs to use when generating unnamed
+    /// constant strings.  These names get run through the Mangler later; if
+    /// you want the Mangler not to add the GlobalPrefix as well, 
+    /// use '\1' as the first character.
+    const char *StringConstantPrefix;     // Defaults to ".str"
+
     //===--- Data Emission Directives -------------------------------------===//
 
     /// ZeroDirective - this should be set to the directive used to get some
@@ -157,6 +192,10 @@ namespace llvm {
     /// boundary.
     bool AlignmentIsInBytes;              // Defaults to true
 
+    /// TextAlignFillValue - If non-zero, this is used to fill the executable
+    /// space created as the result of a alignment directive.
+    unsigned TextAlignFillValue;
+
     //===--- Section Switching Directives ---------------------------------===//
     
     /// SwitchToSectionDirective - This is the directive used when we want to
@@ -190,7 +229,7 @@ namespace llvm {
     const char *JumpTableDirective;
 
     /// CStringSection - If not null, this allows for special handling of
-    /// cstring constants (\0 terminated string that does not contain any
+    /// cstring constants (null terminated string that does not contain any
     /// other null bytes) on this target. This is commonly supported as
     /// ".cstring".
     const char *CStringSection;           // Defaults to NULL
@@ -230,8 +269,8 @@ namespace llvm {
     /// LCOMMDirective - This is the name of a directive (if supported) that can
     /// be used to efficiently declare a local (internal) block of zero
     /// initialized data in the .bss/.data section.  The syntax expected is:
-    /// \literal <LCOMMDirective> SYMBOLNAME LENGTHINBYTES, ALIGNMENT
-    /// \endliteral
+    /// @verbatim <LCOMMDirective> SYMBOLNAME LENGTHINBYTES, ALIGNMENT
+    /// @endverbatim
     const char *LCOMMDirective;           // Defaults to null.
     
     const char *COMMDirective;            // Defaults to "\t.comm\t".
@@ -253,6 +292,10 @@ namespace llvm {
     /// global as being a weak undefined symbol.
     const char *WeakRefDirective;         // Defaults to null.
     
+    /// WeakDefDirective - This directive, if non-null, is used to declare a
+    /// global as being a weak defined symbol.
+    const char *WeakDefDirective;         // Defaults to null.
+    
     /// HiddenDirective - This directive, if non-null, is used to declare a
     /// global or function as having hidden visibility.
     const char *HiddenDirective;          // Defaults to "\t.hidden\t".
@@ -275,14 +318,11 @@ namespace llvm {
     ///
     bool HasLEB128; // Defaults to false.
     
-    /// hasDotLoc - True if target asm supports .loc directives.
+    /// hasDotLocAndDotFile - True if target asm supports .loc and .file
+    /// directives for emitting debugging information.
     ///
-    bool HasDotLoc; // Defaults to false.
+    bool HasDotLocAndDotFile; // Defaults to false.
     
-    /// HasDotFile - True if target asm supports .file directives.
-    ///
-    bool HasDotFile; // Defaults to false.
-
     /// SupportsDebugInformation - True if target supports emission of debugging
     /// information.
     bool SupportsDebugInformation;
@@ -296,6 +336,15 @@ namespace llvm {
     ///
     bool DwarfRequiresFrameSection; // Defaults to true.
 
+    /// GlobalEHDirective - This is the directive used to make exception frame
+    /// tables globally visible.
+    ///
+    const char *GlobalEHDirective;          // Defaults to NULL.
+
+    /// SupportsWeakEmptyEHFrame - True if target assembler and linker will
+    /// handle a weak_definition of constant 0 for an omitted EH frame.
+    bool SupportsWeakOmittedEHFrame;  // Defaults to true.
+
     /// DwarfSectionOffsetDirective - Special section offset directive.
     const char* DwarfSectionOffsetDirective; // Defaults to NULL
     
@@ -354,7 +403,7 @@ namespace llvm {
 
     //===--- CBE Asm Translation Table -----------------------------------===//
 
-    const char** AsmTransCBE; // Defaults to empty
+    const char *const *AsmTransCBE; // Defaults to empty
 
   public:
     TargetAsmInfo();
@@ -371,6 +420,13 @@ namespace llvm {
     virtual bool ExpandInlineAsm(CallInst *CI) const {
       return false;
     }
+
+    /// PreferredEHDataFormat - This hook allows the target to select data
+    /// format used for encoding pointers in exception handling data. Reason is
+    /// 0 for data, 1 for code labels, 2 for function pointers. Global is true
+    /// if the symbol can be relocated.
+    virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
+                                           bool Global) const;
     
     // Accessors.
     //
@@ -392,8 +448,8 @@ namespace llvm {
     const char *getZeroFillDirective() const {
       return ZeroFillDirective;
     }
-    unsigned getAddressSize() const {
-      return AddressSize;
+    const char *getNonexecutableStackDirective() const {
+      return NonexecutableStackDirective;
     }
     bool needsSet() const {
       return NeedsSet;
@@ -428,6 +484,15 @@ namespace llvm {
     const char *getFunctionAddrSuffix() const {
       return FunctionAddrSuffix;
     }
+    const char *getPersonalityPrefix() const {
+      return PersonalityPrefix;
+    }
+    const char *getPersonalitySuffix() const {
+      return PersonalitySuffix;
+    }
+    bool getNeedsIndirectEncoding() const {
+      return NeedsIndirectEncoding;
+    }
     const char *getInlineAsmStart() const {
       return InlineAsmStart;
     }
@@ -437,6 +502,9 @@ namespace llvm {
     unsigned getAssemblerDialect() const {
       return AssemblerDialect;
     }
+    const char *getStringConstantPrefix() const {
+      return StringConstantPrefix;
+    }
     const char *getZeroDirective() const {
       return ZeroDirective;
     }
@@ -470,6 +538,9 @@ namespace llvm {
     bool getAlignmentIsInBytes() const {
       return AlignmentIsInBytes;
     }
+    unsigned getTextAlignFillValue() const {
+      return TextAlignFillValue;
+    }
     const char *getSwitchToSectionDirective() const {
       return SwitchToSectionDirective;
     }
@@ -533,6 +604,9 @@ namespace llvm {
     const char *getWeakRefDirective() const {
       return WeakRefDirective;
     }
+    const char *getWeakDefDirective() const {
+      return WeakDefDirective;
+    }
     const char *getHiddenDirective() const {
       return HiddenDirective;
     }
@@ -548,11 +622,8 @@ namespace llvm {
     bool hasLEB128() const {
       return HasLEB128;
     }
-    bool hasDotLoc() const {
-      return HasDotLoc;
-    }
-    bool hasDotFile() const {
-      return HasDotFile;
+    bool hasDotLocAndDotFile() const {
+      return HasDotLocAndDotFile;
     }
     bool doesSupportDebugInformation() const {
       return SupportsDebugInformation;
@@ -563,6 +634,12 @@ namespace llvm {
     bool doesDwarfRequireFrameSection() const {
       return DwarfRequiresFrameSection;
     }
+    const char *getGlobalEHDirective() const {
+      return GlobalEHDirective;
+    }
+    bool getSupportsWeakOmittedEHFrame() const {
+      return SupportsWeakOmittedEHFrame;
+    }
     const char *getDwarfSectionOffsetDirective() const {
       return DwarfSectionOffsetDirective;
     }    
@@ -605,7 +682,7 @@ namespace llvm {
     const char *getDwarfExceptionSection() const {
       return DwarfExceptionSection;
     }
-    const char** getAsmCBE() const {
+    const char *const *getAsmCBE() const {
       return AsmTransCBE;
     }
   };