cgraph.h (cgraph_rtl_info): Move to rtl.h
authorAndrew MacLeod <amacleod@redhat.com>
Thu, 25 Jun 2015 16:23:52 +0000 (16:23 +0000)
committerAndrew Macleod <amacleod@gcc.gnu.org>
Thu, 25 Jun 2015 16:23:52 +0000 (16:23 +0000)
2015-06-25  Andrew MacLeod  <amacleod@redhat.com>

* cgraph.h (cgraph_rtl_info): Move to rtl.h
(cgraph_node): Maintain pointer to struct cgraph_rtl_info instead of
and instance.
* rtl.h (struct cgraph_rtl_info): Define when HARD_REG_SET available.
* cgraph.c (cgraph_node::rtl_info): Allocate cgraph_rtl_info if one
doesn't exist.
* calls.c: Include hard-reg-set.h before rtl.h.
* ira.c: Likewise.

From-SVN: r224946

gcc/ChangeLog
gcc/calls.c
gcc/cgraph.c
gcc/cgraph.h
gcc/ira.c
gcc/rtl.h

index 157c23e88661d700cb8b35d27b06abe4f1c90894..8280777f5f3da7960f983c2e8e6f11b1362bbda0 100644 (file)
@@ -1,3 +1,14 @@
+2015-06-25  Andrew MacLeod  <amacleod@redhat.com>
+
+       * cgraph.h (cgraph_rtl_info): Move to rtl.h
+       (cgraph_node): Maintain pointer to struct cgraph_rtl_info instead of
+       and instance.
+       * rtl.h (struct cgraph_rtl_info): Define when HARD_REG_SET available.
+       * cgraph.c (cgraph_node::rtl_info): Allocate cgraph_rtl_info if one
+       doesn't exist.
+       * calls.c: Include hard-reg-set.h before rtl.h.
+       * ira.c: Likewise.
+
 2015-06-25  Zhouyi Zhou  <yizhouzhou@ict.ac.cn>
            Vladimir Makarov  <vmakarov@redhat.com>
 
index d632881f4b4be8df59c7c0500549c2fab545ab30..5cf0dca64598a198e7da3dbe6f203ac80bdfff65 100644 (file)
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
+#include "hard-reg-set.h"
 #include "rtl.h"
 #include "alias.h"
 #include "symtab.h"
@@ -31,7 +32,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "stringpool.h"
 #include "attribs.h"
 #include "predict.h"
-#include "hard-reg-set.h"
 #include "function.h"
 #include "basic-block.h"
 #include "tree-ssa-alias.h"
index e530568a53688924ce628f9ccf360bacc73c4efe..60f90060187cf759c22b9dd263e00bf2eb1a249f 100644 (file)
@@ -1892,7 +1892,10 @@ cgraph_node::rtl_info (tree decl)
   if (node->decl != current_function_decl
       && !TREE_ASM_WRITTEN (node->decl))
     return NULL;
-  return &node->ultimate_alias_target ()->rtl;
+  /* Allocate if it doesnt exist.  */
+  if (node->ultimate_alias_target ()->rtl == NULL)
+    node->ultimate_alias_target ()->rtl = ggc_cleared_alloc<cgraph_rtl_info> ();
+  return node->ultimate_alias_target ()->rtl;
 }
 
 /* Return a string describing the failure REASON.  */
index 55864a279485e23c0c6d3f9bb1e647b77b97c63d..62d4ad6ee7c623208838a38fc0f45a37ecf3d9e5 100644 (file)
@@ -613,20 +613,6 @@ struct GTY(()) cgraph_global_info {
   cgraph_node *inlined_to;
 };
 
-/* Information about the function that is propagated by the RTL backend.
-   Available only for functions that has been already assembled.  */
-
-struct GTY(()) cgraph_rtl_info {
-   unsigned int preferred_incoming_stack_boundary;
-
-  /* Call unsaved hard registers really used by the corresponding
-     function (including ones used by functions called by the
-     function).  */
-  HARD_REG_SET function_used_regs;
-  /* Set if function_used_regs is valid.  */
-  unsigned function_used_regs_valid: 1;
-};
-
 /* Represent which DECL tree (or reference to such tree)
    will be replaced by another tree while versioning.  */
 struct GTY(()) ipa_replace_map
@@ -1194,7 +1180,7 @@ public:
   static cgraph_local_info *local_info (tree decl);
 
   /* Return local info for the compiled function.  */
-  static cgraph_rtl_info *rtl_info (tree);
+  static struct cgraph_rtl_info *rtl_info (tree);
 
   /* Return the cgraph node that has ASMNAME for its DECL_ASSEMBLER_NAME.
      Return NULL if there's no such node.  */
@@ -1263,7 +1249,7 @@ public:
 
   cgraph_local_info local;
   cgraph_global_info global;
-  cgraph_rtl_info rtl;
+  struct cgraph_rtl_info *rtl;
   cgraph_clone_info clone;
   cgraph_thunk_info thunk;
 
index c95f57b9f8832f6fc0e3b1fa819fabf4fd943bb3..92d5eb11ed7c71ce682145db958805610f5319ab 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -371,13 +371,13 @@ along with GCC; see the file COPYING3.  If not see
 #include "alias.h"
 #include "symtab.h"
 #include "tree.h"
+#include "hard-reg-set.h"
 #include "rtl.h"
 #include "tm_p.h"
 #include "target.h"
 #include "flags.h"
 #include "obstack.h"
 #include "bitmap.h"
-#include "hard-reg-set.h"
 #include "predict.h"
 #include "function.h"
 #include "dominance.h"
index 5b4a525cd9b7334f58194e6a4b15c37bd5d476c9..07c5f6504a66c18acf6b54dc2bdf793e7fdc091a 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -3710,4 +3710,21 @@ extern void _fatal_insn (const char *, const_rtx, const char *, int, const char
 /* reginfo.c */
 extern tree GTY(()) global_regs_decl[FIRST_PSEUDO_REGISTER];
 
+#ifdef HARD_CONST
+/* Information about the function that is propagated by the RTL backend.
+   Available only for functions that has been already assembled.  */
+
+struct GTY(()) cgraph_rtl_info {
+   unsigned int preferred_incoming_stack_boundary;
+
+  /* Call unsaved hard registers really used by the corresponding
+     function (including ones used by functions called by the
+     function).  */
+  HARD_REG_SET function_used_regs;
+  /* Set if function_used_regs is valid.  */
+  unsigned function_used_regs_valid: 1;
+};
+#endif
+
+
 #endif /* ! GCC_RTL_H */