public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1351] analyzer: make various region_model member functions const Date: Wed, 9 Jun 2021 22:32:55 +0000 (GMT) [thread overview] Message-ID: <20210609223255.F2F8D39BE42F@sourceware.org> (raw) https://gcc.gnu.org/g:53cb324cb4f9475d4eabcd9f5a858c5edaacc0cf commit r12-1351-g53cb324cb4f9475d4eabcd9f5a858c5edaacc0cf Author: David Malcolm <dmalcolm@redhat.com> Date: Wed Jun 9 18:32:08 2021 -0400 analyzer: make various region_model member functions const gcc/analyzer/ChangeLog: * region-model.cc (region_model::get_lvalue_1): Make const. (region_model::get_lvalue): Likewise. (region_model::get_rvalue_1): Likewise. (region_model::get_rvalue): Likewise. (region_model::deref_rvalue): Likewise. (region_model::get_rvalue_for_bits): Likewise. * region-model.h (region_model::get_lvalue): Likewise. (region_model::get_rvalue): Likewise. (region_model::deref_rvalue): Likewise. (region_model::get_rvalue_for_bits): Likewise. (region_model::get_lvalue_1): Likewise. (region_model::get_rvalue_1): Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com> Diff: --- gcc/analyzer/region-model.cc | 16 ++++++++-------- gcc/analyzer/region-model.h | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index 0d363fb15d3..551ee796b11 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -1213,7 +1213,7 @@ region_model::handle_phi (const gphi *phi, emitting any diagnostics to CTXT. */ const region * -region_model::get_lvalue_1 (path_var pv, region_model_context *ctxt) +region_model::get_lvalue_1 (path_var pv, region_model_context *ctxt) const { tree expr = pv.m_tree; @@ -1312,7 +1312,7 @@ assert_compat_types (tree src_type, tree dst_type) emitting any diagnostics to CTXT. */ const region * -region_model::get_lvalue (path_var pv, region_model_context *ctxt) +region_model::get_lvalue (path_var pv, region_model_context *ctxt) const { if (pv.m_tree == NULL_TREE) return NULL; @@ -1326,7 +1326,7 @@ region_model::get_lvalue (path_var pv, region_model_context *ctxt) recent stack frame if it's a local). */ const region * -region_model::get_lvalue (tree expr, region_model_context *ctxt) +region_model::get_lvalue (tree expr, region_model_context *ctxt) const { return get_lvalue (path_var (expr, get_stack_depth () - 1), ctxt); } @@ -1337,7 +1337,7 @@ region_model::get_lvalue (tree expr, region_model_context *ctxt) emitting any diagnostics to CTXT. */ const svalue * -region_model::get_rvalue_1 (path_var pv, region_model_context *ctxt) +region_model::get_rvalue_1 (path_var pv, region_model_context *ctxt) const { gcc_assert (pv.m_tree); @@ -1441,7 +1441,7 @@ region_model::get_rvalue_1 (path_var pv, region_model_context *ctxt) emitting any diagnostics to CTXT. */ const svalue * -region_model::get_rvalue (path_var pv, region_model_context *ctxt) +region_model::get_rvalue (path_var pv, region_model_context *ctxt) const { if (pv.m_tree == NULL_TREE) return NULL; @@ -1457,7 +1457,7 @@ region_model::get_rvalue (path_var pv, region_model_context *ctxt) recent stack frame if it's a local). */ const svalue * -region_model::get_rvalue (tree expr, region_model_context *ctxt) +region_model::get_rvalue (tree expr, region_model_context *ctxt) const { return get_rvalue (path_var (expr, get_stack_depth () - 1), ctxt); } @@ -1624,7 +1624,7 @@ region_model::region_exists_p (const region *reg) const const region * region_model::deref_rvalue (const svalue *ptr_sval, tree ptr_tree, - region_model_context *ctxt) + region_model_context *ctxt) const { gcc_assert (ptr_sval); gcc_assert (POINTER_TYPE_P (ptr_sval->get_type ())); @@ -1705,7 +1705,7 @@ region_model::deref_rvalue (const svalue *ptr_sval, tree ptr_tree, const svalue * region_model::get_rvalue_for_bits (tree type, const region *reg, - const bit_range &bits) + const bit_range &bits) const { const svalue *sval = get_store_value (reg); if (const compound_svalue *compound_sval = sval->dyn_cast_compound_svalue ()) diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h index 5e43e547199..e251a5b245c 100644 --- a/gcc/analyzer/region-model.h +++ b/gcc/analyzer/region-model.h @@ -501,17 +501,17 @@ class region_model int get_stack_depth () const; const frame_region *get_frame_at_index (int index) const; - const region *get_lvalue (path_var pv, region_model_context *ctxt); - const region *get_lvalue (tree expr, region_model_context *ctxt); - const svalue *get_rvalue (path_var pv, region_model_context *ctxt); - const svalue *get_rvalue (tree expr, region_model_context *ctxt); + const region *get_lvalue (path_var pv, region_model_context *ctxt) const; + const region *get_lvalue (tree expr, region_model_context *ctxt) const; + const svalue *get_rvalue (path_var pv, region_model_context *ctxt) const; + const svalue *get_rvalue (tree expr, region_model_context *ctxt) const; const region *deref_rvalue (const svalue *ptr_sval, tree ptr_tree, - region_model_context *ctxt); + region_model_context *ctxt) const; const svalue *get_rvalue_for_bits (tree type, const region *reg, - const bit_range &bits); + const bit_range &bits) const; void set_value (const region *lhs_reg, const svalue *rhs_sval, region_model_context *ctxt); @@ -585,8 +585,8 @@ class region_model void loop_replay_fixup (const region_model *dst_state); private: - const region *get_lvalue_1 (path_var pv, region_model_context *ctxt); - const svalue *get_rvalue_1 (path_var pv, region_model_context *ctxt); + const region *get_lvalue_1 (path_var pv, region_model_context *ctxt) const; + const svalue *get_rvalue_1 (path_var pv, region_model_context *ctxt) const; path_var get_representative_path_var_1 (const svalue *sval,
reply other threads:[~2021-06-09 22:32 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210609223255.F2F8D39BE42F@sourceware.org \ --to=dmalcolm@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).