diff options
author | David Malcolm <dmalcolm@redhat.com> | 2021-03-10 12:00:34 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2021-03-10 12:00:34 -0500 |
commit | 6b78729186060cf96c0b4e0f3eacf155f4e90376 (patch) | |
tree | d31b56ded229a284bae4d6835846301abf9b2663 /gcc | |
parent | 5bf998275aff311b9804c1de944a88c219f35db6 (diff) | |
download | gcc-6b78729186060cf96c0b4e0f3eacf155f4e90376.zip gcc-6b78729186060cf96c0b4e0f3eacf155f4e90376.tar.gz gcc-6b78729186060cf96c0b4e0f3eacf155f4e90376.tar.bz2 |
committed: analyzer: remove duplicated vfuncs
Implement dyn_cast_callgraph_superedge once in callgraph_superedge,
rather than twice in the two subclasses.
Spotted whilst working on a patch for call summaries.
gcc/analyzer/ChangeLog:
* supergraph.h
(callgraph_superedge::dyn_cast_callgraph_superedge): New.
(call_superedge::dyn_cast_callgraph_superedge): Delete.
(return_superedge::dyn_cast_callgraph_superedge): Delete.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/analyzer/supergraph.h | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/gcc/analyzer/supergraph.h b/gcc/analyzer/supergraph.h index fc4a753..5d1268e 100644 --- a/gcc/analyzer/supergraph.h +++ b/gcc/analyzer/supergraph.h @@ -371,6 +371,16 @@ class callgraph_superedge : public superedge void dump_label_to_pp (pretty_printer *pp, bool user_facing) const FINAL OVERRIDE; + callgraph_superedge *dyn_cast_callgraph_superedge () FINAL OVERRIDE + { + return this; + } + const callgraph_superedge *dyn_cast_callgraph_superedge () const + FINAL OVERRIDE + { + return this; + } + function *get_callee_function () const; function *get_caller_function () const; tree get_callee_decl () const; @@ -409,16 +419,6 @@ class call_superedge : public callgraph_superedge : callgraph_superedge (src, dst, SUPEREDGE_CALL, cedge) {} - callgraph_superedge *dyn_cast_callgraph_superedge () FINAL OVERRIDE - { - return this; - } - const callgraph_superedge *dyn_cast_callgraph_superedge () const - FINAL OVERRIDE - { - return this; - } - call_superedge *dyn_cast_call_superedge () FINAL OVERRIDE { return this; @@ -455,14 +455,6 @@ class return_superedge : public callgraph_superedge : callgraph_superedge (src, dst, SUPEREDGE_RETURN, cedge) {} - callgraph_superedge *dyn_cast_callgraph_superedge () FINAL OVERRIDE - { - return this; - } - const callgraph_superedge *dyn_cast_callgraph_superedge () const - FINAL OVERRIDE - { return this; } - return_superedge *dyn_cast_return_superedge () FINAL OVERRIDE { return this; } const return_superedge *dyn_cast_return_superedge () const FINAL OVERRIDE { |