Use a better name for the label relocations while emitting them for Jump Tables
[oota-llvm.git] / include / llvm / Target / TargetAsmInfo.h
index b73cdb9c45e341816d33f69fb412f4ddc74fe8f4..50e08bda445c9118bcfe829fdb15337846c27157 100644 (file)
@@ -36,8 +36,12 @@ namespace llvm {
       Unknown = 0,      ///< Custom section
       Text,             ///< Text section
       Data,             ///< Data section
+      DataRel,          ///< Contains data that has relocations
+      DataRelLocal,     ///< Contains data that has only local relocations
       BSS,              ///< BSS section
       ROData,           ///< Readonly data section
+      DataRelRO,        ///< Contains data that is otherwise readonly
+      DataRelROLocal,   ///< Contains r/o data with only local relocations
       RODataMergeStr,   ///< Readonly data section (mergeable strings)
       RODataMergeConst, ///< Readonly data section (mergeable constants)
       SmallData,        ///< Small data section
@@ -126,7 +130,6 @@ namespace llvm {
   private:
     mutable StringMap<Section> Sections;
     mutable SectionFlags::FlagsStringsMapType FlagsStrings;
-    void fillDefaultValues();
   protected:
     /// TM - The current TargetMachine.
     const TargetMachine &TM;
@@ -211,6 +214,10 @@ namespace llvm {
     /// measure inline asm instructions.
     char SeparatorChar;                   // Defaults to ';'
 
+    /// CommentColumn - This indicates the comment num (zero-based) at
+    /// which asm comments should be printed.
+    unsigned CommentColumn;               // Defaults to 60
+
     /// CommentString - This indicates the comment character used by the
     /// assembler.
     const char *CommentString;            // Defaults to "#"
@@ -268,12 +275,10 @@ 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"
-
+    /// AllowQuotesInName - This is true if the assembler allows for complex
+    /// symbol names to be surrounded in quotes.  This defaults to false.
+    bool AllowQuotesInName;
+    
     //===--- Data Emission Directives -------------------------------------===//
 
     /// ZeroDirective - this should be set to the directive used to get some
@@ -304,8 +309,7 @@ namespace llvm {
     /// directives for various sizes and non-default address spaces.
     virtual const char *getASDirective(unsigned size, 
                                        unsigned AS) const {
-      assert (AS > 0 
-              && "Dont know the directives for default addr space");
+      assert(AS > 0 && "Dont know the directives for default addr space");
       return NULL;
     }
 
@@ -380,6 +384,11 @@ namespace llvm {
     /// GlobalDirective - This is the directive used to declare a global entity.
     ///
     const char *GlobalDirective;          // Defaults to NULL.
+
+    /// ExternDirective - This is the directive used to declare external 
+    /// globals.
+    ///
+    const char *ExternDirective;          // Defaults to NULL.
     
     /// SetDirective - This is the name of a directive that can be used to tell
     /// the assembler to set the value of a variable to some expression.
@@ -459,13 +468,13 @@ namespace llvm {
     ///
     bool DwarfRequiresFrameSection; // Defaults to true.
 
-    /// SupportsMacInfo - true if the Dwarf output supports macro information
-    ///
-    bool SupportsMacInfoSection;            // Defaults to true
+    /// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection is used to
+    /// encode inline subroutine information.
+    bool DwarfUsesInlineInfoSection; // Defaults to false.
 
-    /// NonLocalEHFrameLabel - If set, the EH_frame label needs to be non-local.
-    ///
-    bool NonLocalEHFrameLabel;              // Defaults to false.
+    /// Is_EHSymbolPrivate - If set, the "_foo.eh" is made private so that it
+    /// doesn't show up in the symbol table of the object file.
+    bool Is_EHSymbolPrivate;                // Defaults to true.
 
     /// GlobalEHDirective - This is the directive used to make exception frame
     /// tables globally visible.
@@ -502,7 +511,11 @@ namespace llvm {
     /// DwarfPubTypesSection - Section directive for Dwarf info.
     ///
     const char *DwarfPubTypesSection; // Defaults to ".debug_pubtypes".
-    
+
+    /// DwarfDebugInlineSection - Section directive for inline info.
+    ///
+    const char *DwarfDebugInlineSection; // Defaults to ".debug_inlined"
+
     /// DwarfStrSection - Section directive for Dwarf info.
     ///
     const char *DwarfStrSection; // Defaults to ".debug_str".
@@ -519,9 +532,9 @@ namespace llvm {
     ///
     const char *DwarfRangesSection; // Defaults to ".debug_ranges".
 
-    /// DwarfMacInfoSection - Section directive for Dwarf info.
+    /// DwarfMacroInfoSection - Section directive for DWARF macro info.
     ///
-    const char *DwarfMacInfoSection; // Defaults to ".debug_macinfo".
+    const char *DwarfMacroInfoSection; // Defaults to ".debug_macinfo".
     
     /// DwarfEHFrameSection - Section directive for Exception frames.
     ///
@@ -577,6 +590,12 @@ namespace llvm {
     virtual SectionKind::Kind
     SectionKindForGlobal(const GlobalValue *GV) const;
 
+    /// RelocBehaviour - Describes how relocations should be treated when
+    /// selecting sections. Reloc::Global bit should be set if global
+    /// relocations should force object to be placed in read-write
+    /// sections. Reloc::Local bit should be set if local relocations should
+    /// force object to be placed in read-write sections.
+    virtual unsigned RelocBehaviour() const;
 
     /// SectionFlagsForGlobal - This hook allows the target to select proper
     /// section flags either for given global or for section.
@@ -672,6 +691,9 @@ namespace llvm {
     char getSeparatorChar() const {
       return SeparatorChar;
     }
+    unsigned getCommentColumn() const {
+      return CommentColumn;
+    }
     const char *getCommentString() const {
       return CommentString;
     }
@@ -681,12 +703,6 @@ namespace llvm {
     const char *getPrivateGlobalPrefix() const {
       return PrivateGlobalPrefix;
     }
-    /// EHGlobalPrefix - Prefix for EH_frame and the .eh symbols.
-    /// This is normally PrivateGlobalPrefix, but some targets want
-    /// these symbols to be visible.
-    virtual const char *getEHGlobalPrefix() const {
-      return PrivateGlobalPrefix;
-    }
     const char *getLessPrivateGlobalPrefix() const {
       return LessPrivateGlobalPrefix;
     }
@@ -723,8 +739,8 @@ namespace llvm {
     unsigned getAssemblerDialect() const {
       return AssemblerDialect;
     }
-    const char *getStringConstantPrefix() const {
-      return StringConstantPrefix;
+    bool doesAllowQuotesInName() const {
+      return AllowQuotesInName;
     }
     const char *getZeroDirective() const {
       return ZeroDirective;
@@ -783,6 +799,9 @@ namespace llvm {
     const char *getGlobalDirective() const {
       return GlobalDirective;
     }
+    const char *getExternDirective() const {
+      return ExternDirective;
+    }
     const char *getSetDirective() const {
       return SetDirective;
     }
@@ -837,11 +856,11 @@ namespace llvm {
     bool doesDwarfRequireFrameSection() const {
       return DwarfRequiresFrameSection;
     }
-    bool doesSupportMacInfoSection() const {
-      return SupportsMacInfoSection;
+    bool doesDwarfUsesInlineInfoSection() const {
+      return DwarfUsesInlineInfoSection;
     }
-    bool doesRequireNonLocalEHFrameLabel() const {
-      return NonLocalEHFrameLabel;
+    bool is_EHSymbolPrivate() const {
+      return Is_EHSymbolPrivate;
     }
     const char *getGlobalEHDirective() const {
       return GlobalEHDirective;
@@ -870,6 +889,9 @@ namespace llvm {
     const char *getDwarfPubTypesSection() const {
       return DwarfPubTypesSection;
     }
+    const char *getDwarfDebugInlineSection() const {
+      return DwarfDebugInlineSection;
+    }
     const char *getDwarfStrSection() const {
       return DwarfStrSection;
     }
@@ -882,8 +904,8 @@ namespace llvm {
     const char *getDwarfRangesSection() const {
       return DwarfRangesSection;
     }
-    const char *getDwarfMacInfoSection() const {
-      return DwarfMacInfoSection;
+    const char *getDwarfMacroInfoSection() const {
+      return DwarfMacroInfoSection;
     }
     const char *getDwarfEHFrameSection() const {
       return DwarfEHFrameSection;