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.
This commit is contained in:
David Malcolm 2021-03-10 12:00:34 -05:00
parent 5bf998275a
commit 6b78729186
1 changed files with 10 additions and 18 deletions

View File

@ -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
{