OSDN Git Service

2005-12-28 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
[pf3gnuchains/gcc-fork.git] / gcc / target.h
index 564c333..6a49463 100644 (file)
@@ -52,6 +52,21 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 struct stdarg_info;
 
+/* The struct used by the secondary_reload target hook.  */
+typedef struct secondary_reload_info
+{
+  /* icode is actually an enum insn_code, but we don't want to force every
+     file that includes target.h to include optabs.h .  */
+  int icode;
+  int extra_cost; /* Cost for using (a) scratch register(s) to be taken
+                    into account by copy_cost.  */
+  /* The next two members are for the use of the backward
+     compatibility hook.  */
+  struct secondary_reload_info *prev_sri;
+  int t_icode; /* Actually an enum insn_code - see above.  */
+} secondary_reload_info;
+
+
 struct gcc_target
 {
   /* Functions that output assembler for the target.  */
@@ -112,35 +127,31 @@ struct gcc_target
     /* Output the assembler code for function exit.  */
     void (* function_epilogue) (FILE *, HOST_WIDE_INT);
 
+    /* Initialize target-specific sections.  */
+    void (* init_sections) (void);
+
     /* Tell assembler to change to section NAME with attributes FLAGS.
        If DECL is non-NULL, it is the VAR_DECL or FUNCTION_DECL with
        which this section is associated.  */
     void (* named_section) (const char *name, unsigned int flags, tree decl);
 
-    /* Switch to the section that holds the exception table.  */
-    void (* exception_section) (void);
-
-    /* Switch to the section that holds the exception frames.  */
-    void (* eh_frame_section) (void);
+    /* Return a section for EXP.  It may be a DECL or a constant.  RELOC
+       is nonzero if runtime relocations must be applied; bit 1 will be
+       set if the runtime relocations require non-local name resolution.
+       ALIGN is the required alignment of the data.  */
+    section *(* select_section) (tree, int, unsigned HOST_WIDE_INT);
 
-    /* Select and switch to a section for EXP.  It may be a DECL or a
-       constant.  RELOC is nonzero if runtime relocations must be applied;
-       bit 1 will be set if the runtime relocations require non-local
-       name resolution.  ALIGN is the required alignment of the data.  */
-    void (* select_section) (tree, int, unsigned HOST_WIDE_INT);
-
-    /* Select and switch to a section for X with MODE.  ALIGN is
-       the desired alignment of the data.  */
-    void (* select_rtx_section) (enum machine_mode, rtx,
-                                unsigned HOST_WIDE_INT);
+    /* Return a section for X.  MODE is X's mode and ALIGN is its
+       alignment in bits.  */
+    section *(* select_rtx_section) (enum machine_mode, rtx,
+                                    unsigned HOST_WIDE_INT);
 
     /* Select a unique section name for DECL.  RELOC is the same as
        for SELECT_SECTION.  */
     void (* unique_section) (tree, int);
 
-    /* Tell assembler to switch to the readonly data section associated
-       with function DECL.  */
-    void (* function_rodata_section) (tree);
+    /* Return the readonly data section associated with function DECL.  */
+    section *(* function_rodata_section) (tree);
 
     /* Output a constructor for a symbol with a given priority.  */
     void (* constructor) (rtx, int);
@@ -341,6 +352,9 @@ struct gcc_target
      Microsoft Visual C++ bitfield layout rules.  */
   bool (* ms_bitfield_layout_p) (tree record_type);
 
+  /* True if the target supports decimal floating point.  */
+  bool (* decimal_float_supported_p) (void);
+
   /* Return true if anonymous bitfields affect structure alignment.  */
   bool (* align_anon_bitfield) (void);
 
@@ -550,6 +564,11 @@ struct gcc_target
   /* Returns NULL if target supports the insn within a doloop block,
      otherwise it returns an error message.  */
   const char * (*invalid_within_doloop) (rtx);
+
+  /* DECL is a variable or function with __attribute__((dllimport))
+     specified.  Use this hook if the target needs to add extra validation
+     checks to  handle_dll_attribute ().  */
+  bool (* valid_dllimport_attribute_p) (tree decl);
     
   /* Functions relating to calls - argument passing, returns, etc.  */
   struct calls {
@@ -608,6 +627,10 @@ struct gcc_target
        specified by FN_DECL_OR_TYPE with a return type of RET_TYPE.  */
     rtx (*function_value) (tree ret_type, tree fn_decl_or_type,
                           bool outgoing);
+
+    /* Return an rtx for the argument pointer incoming to the
+       current function.  */
+    rtx (*internal_arg_pointer) (void);
   } calls;
 
   /* Return the diagnostic message string if conversion from FROMTYPE
@@ -622,6 +645,11 @@ struct gcc_target
      is not permitted on TYPE1 and TYPE2, NULL otherwise.  */
   const char *(*invalid_binary_op) (int op, tree type1, tree type2);
 
+  /* Return the class for a secondary reload, and fill in extra information.  */
+  enum reg_class (*secondary_reload) (bool, rtx, enum reg_class,
+                                     enum machine_mode,
+                                     struct secondary_reload_info *);
+
   /* Functions specific to the C++ frontend.  */
   struct cxx {
     /* Return the integer type used for guard variables.  */
@@ -660,6 +688,11 @@ struct gcc_target
     /* Returns true if __aeabi_atexit should be used to register static
        destructors.  */
     bool (*use_aeabi_atexit) (void);
+    /* TYPE is a C++ class (i.e., RECORD_TYPE or UNION_TYPE) that
+       has just been defined.  Use this hook to make adjustments to the
+       class  (eg, tweak visibility or perform any other required
+       target modifications).  */  
+    void (*adjust_class_at_definition) (tree type);
   } cxx;
 
   /* True if unwinding tables should be generated by default.  */