summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2019-09-27 18:12:56 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2019-09-27 18:12:56 +0000
commit975d043ff6b6f8a9e9ff0be799701fc1d842bb83 (patch)
treecf6122077a6123434033acb264517f631206f6f5 /gcc
parent37ed4c3269f940a3a064e320331aed38890fb8c0 (diff)
Make cgraph_node::get_fun const
gcc/ChangeLog: * cgraph.c (cgraph_node::get_fun): Make const. * cgraph.h (cgraph_node::get_fun): Likewise. From-SVN: r276190
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cgraph.c4
-rw-r--r--gcc/cgraph.h2
3 files changed, 8 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8e4e143edc4..05ba915193e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2019-09-27 David Malcolm <dmalcolm@redhat.com>
+
+ * cgraph.c (cgraph_node::get_fun): Make const.
+ * cgraph.h (cgraph_node::get_fun): Likewise.
+
2019-09-27 Jakub Jelinek <jakub@redhat.com>
PR target/91919
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 331b363c175..8615e2eca36 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -3602,9 +3602,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 1da6cab54b0..195e6e9a96e 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -1142,7 +1142,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);