This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch preview] New target hooks


In line with the seeming approval of my plan to mass-adopt target
hooks, I've started converting the hooks I need for my current
project.  Here is a preview of the new hooks, so that we can at least
approve the API (I'm still working on the docs etc).

Note that many of these have an extra parameter to pass the function
decl (or type) through.  This is because I'm working on supporting
cross-linking with renesas and non-renesas objects for sh-elf, and it
needs to modify the function call abi on a per-function basis.  This,
naturally, involves patching a number of common files (primarily,
aggregate_value_p() needs another parameter too, so all its callers
are modified).

The new reverse_bitfield_layout_p is for the bitfield ordering problem
I reported earlier; I had to add new functionality to support it,
patch later.

So, how's this so far?

Index: target.h
===================================================================
RCS file: /cvs/uberbaum/gcc/target.h,v
retrieving revision 1.61
diff -p -2 -r1.61 target.h
*** target.h    6 Jul 2003 12:35:55 -0000       1.61
--- target.h    31 Jul 2003 16:00:36 -0000
*************** struct gcc_target
*** 279,282 ****
--- 279,286 ----
    bool (* ms_bitfield_layout_p) (tree record_type);
  
+   /* Return true if bitfields in RECORD_TYPE should be allocated
+      within their base type's bytes starting at the opposite end.  */
+   bool (* reverse_bitfield_layout_p) (tree record_type);
+ 
    /* Set up target-specific built-in functions.  */
    void (* init_builtins) (void);
*************** struct gcc_target
*** 387,390 ****
--- 391,411 ----
       at the beginning of assembly output.  */
    bool file_start_file_directive;
+ 
+   /* Functions relating to calls - argument passing, returns, etc.  */
+   struct calls {
+     bool (*promote_function_args) (tree fndecl);
+     bool (*promote_function_return) (tree fndecl);
+     bool (*promote_prototypes) (tree fndecl);
+     rtx (*struct_value_rtx) (tree fndecl, int incoming);
+     int (*return_in_memory) (tree type, tree fndecl);
+     rtx (*expand_builtin_saveregs) (void);
+     /* Returns pretend_argument_size.  */
+     void (*setup_incoming_varargs) (CUMULATIVE_ARGS *ca, enum machine_mode mode,
+                                   tree type, int *pretend_arg_size, int second_time);
+     int (*strict_argument_naming) (CUMULATIVE_ARGS *ca);
+     /* Returns true if we should use SETUP_INCOMING_VARARGS and/or
+        STRICT_ARGUMENT_NAMING. */
+     bool (*pretend_outgoing_varargs_named) (CUMULATIVE_ARGS *ca);
+   } calls;
  };
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]