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]

[DRAGONEGG] Expose 4 functions in i386.c


My plugin currently needs to be able to call the functions type_natural_mode,
classify_argument, examine_argument and contains_aligned_value_p, which are
defined in config/i386/i386.c.  This patch makes them non-static (and adds
declarations - otherwise bootstrap breaks).  I've been resisting sending this
patch because (1) in the long run I believe I can rework the plugin to not
need access to these functions; and (2) it is of no intrinsic interest to gcc:
it only benefits my plugin.  However it would clearly make life much easier for
my users, since they would then not need to build their own patched version of
gcc.  OK to apply to the 4.5 branch and mainline?

Ciao,

Duncan.
Index: mainline/gcc/config/i386/i386.c
===================================================================
--- mainline.orig/gcc/config/i386/i386.c	2010-04-13 11:16:47.616371058 +0200
+++ mainline/gcc/config/i386/i386.c	2010-04-13 15:49:02.166372538 +0200
@@ -5042,7 +5042,8 @@
    case, we return the original mode and warn ABI change if CUM isn't
    NULL.  */
 
-static enum machine_mode
+enum machine_mode type_natural_mode (const_tree, CUMULATIVE_ARGS *);
+enum machine_mode
 type_natural_mode (const_tree type, CUMULATIVE_ARGS *cum)
 {
   enum machine_mode mode = TYPE_MODE (type);
@@ -5173,7 +5174,9 @@
    See the x86-64 PS ABI for details.
 */
 
-static int
+int classify_argument (enum machine_mode, const_tree,
+                       enum x86_64_reg_class [MAX_CLASSES], int);
+int
 classify_argument (enum machine_mode mode, const_tree type,
 		   enum x86_64_reg_class classes[MAX_CLASSES], int bit_offset)
 {
@@ -5554,7 +5557,8 @@
 
 /* Examine the argument and return set number of register required in each
    class.  Return 0 iff parameter should be passed in memory.  */
-static int
+int examine_argument (enum machine_mode, const_tree, int, int *, int *);
+int
 examine_argument (enum machine_mode mode, const_tree type, int in_return,
 		  int *int_nregs, int *sse_nregs)
 {
@@ -6236,7 +6240,8 @@
 
 /* Return true when TYPE should be 128bit aligned for 32bit argument passing
    ABI.  */
-static bool
+bool contains_aligned_value_p (tree);
+bool
 contains_aligned_value_p (tree type)
 {
   enum machine_mode mode = TYPE_MODE (type);
Index: mainline/gcc/ChangeLog
===================================================================
--- mainline.orig/gcc/ChangeLog	2010-04-13 17:17:19.716337925 +0200
+++ mainline/gcc/ChangeLog	2010-04-13 17:21:47.606361494 +0200
@@ -1,5 +1,12 @@
 2010-04-13  Duncan Sands  <baldrick@free.fr>
 
+	* config/i386/i386.c (type_natural_mode): Make non-static.  Declare.
+	(classify_argument): Likewise.
+	(examine_argument): Likewise.
+	(contains_aligned_value_p): Likewise.
+
+2010-04-13  Duncan Sands  <baldrick@free.fr>
+
 	* except.h (lang_eh_type_covers): Remove.
 	* except.c (lang_eh_type_covers): Likewise.
 

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