Simplify some getNode calls.
[oota-llvm.git] / include / llvm / Target / TargetAsmInfo.h
index 8597e40eaf789fe764ff35eefa98eff7a8f6f620..9b5ba4819cb9408041fef3744aa9abd58734fe16 100644 (file)
 #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,12 +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.
     
-    /// 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,
@@ -125,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
@@ -164,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
@@ -313,10 +345,6 @@ namespace llvm {
     /// handle a weak_definition of constant 0 for an omitted EH frame.
     bool SupportsWeakOmittedEHFrame;  // Defaults to true.
 
-    /// ShortenEHDataON64Bit - True if target exception table format requires
-    /// 32-bit data in certain places even when targeting 64-bits.
-    bool ShortenEHDataOn64Bit;    // Defaults to false.
-
     /// DwarfSectionOffsetDirective - Special section offset directive.
     const char* DwarfSectionOffsetDirective; // Defaults to NULL
     
@@ -375,7 +403,7 @@ namespace llvm {
 
     //===--- CBE Asm Translation Table -----------------------------------===//
 
-    const char** AsmTransCBE; // Defaults to empty
+    const char *const *AsmTransCBE; // Defaults to empty
 
   public:
     TargetAsmInfo();
@@ -397,7 +425,8 @@ namespace llvm {
     /// 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(unsigned Reason, bool Global) const;
+    virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
+                                           bool Global) const;
     
     // Accessors.
     //
@@ -419,6 +448,9 @@ namespace llvm {
     const char *getZeroFillDirective() const {
       return ZeroFillDirective;
     }
+    const char *getNonexecutableStackDirective() const {
+      return NonexecutableStackDirective;
+    }
     bool needsSet() const {
       return NeedsSet;
     }
@@ -470,6 +502,9 @@ namespace llvm {
     unsigned getAssemblerDialect() const {
       return AssemblerDialect;
     }
+    const char *getStringConstantPrefix() const {
+      return StringConstantPrefix;
+    }
     const char *getZeroDirective() const {
       return ZeroDirective;
     }
@@ -503,6 +538,9 @@ namespace llvm {
     bool getAlignmentIsInBytes() const {
       return AlignmentIsInBytes;
     }
+    unsigned getTextAlignFillValue() const {
+      return TextAlignFillValue;
+    }
     const char *getSwitchToSectionDirective() const {
       return SwitchToSectionDirective;
     }
@@ -602,9 +640,6 @@ namespace llvm {
     bool getSupportsWeakOmittedEHFrame() const {
       return SupportsWeakOmittedEHFrame;
     }
-    bool getShortenEHDataOn64Bit() const {
-      return ShortenEHDataOn64Bit;
-    }
     const char *getDwarfSectionOffsetDirective() const {
       return DwarfSectionOffsetDirective;
     }    
@@ -647,7 +682,7 @@ namespace llvm {
     const char *getDwarfExceptionSection() const {
       return DwarfExceptionSection;
     }
-    const char** getAsmCBE() const {
+    const char *const *getAsmCBE() const {
       return AsmTransCBE;
     }
   };