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]

[committed] Make cgraph_node::get_fun const


Obvious const-correctness fix; I need this for a patch kit
I'm working on.

Successfully bootstrapped&regrtested on x86_64-pc-linux-gnu.

Committed to trunk (r276190) under the "obvious" rule.

gcc/ChangeLog:
	* cgraph.c (cgraph_node::get_fun): Make const.
	* cgraph.h (cgraph_node::get_fun): Likewise.
---
 gcc/cgraph.c | 4 ++--
 gcc/cgraph.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 843891e..11032e4 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -3671,9 +3671,9 @@ cgraph_node::get_body (void)
 /* Return the DECL_STRUCT_FUNCTION of the function.  */
 
 struct function *
-cgraph_node::get_fun (void)
+cgraph_node::get_fun () const
 {
-  cgraph_node *node = this;
+  const cgraph_node *node = this;
   struct function *fun = DECL_STRUCT_FUNCTION (node->decl);
 
   while (!fun && node->clone_of)
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 4c54210..13818be 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -1131,7 +1131,7 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node
   void release_body (bool keep_arguments = false);
 
   /* Return the DECL_STRUCT_FUNCTION of the function.  */
-  struct function *get_fun (void);
+  struct function *get_fun () const;
 
   /* cgraph_node is no longer nested function; update cgraph accordingly.  */
   void unnest (void);
-- 
1.8.5.3


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