mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-25 19:22:07 +00:00
Cleanup function_decl::parameter::get_pretty_representation
Simplify the logic of function_decl::parameter::get_pretty_representation. * src/abg-ir.cc (function_decl::parameter::get_pretty_representation): Assert that the environment is always non-nil. Then no needs to check for it being non-nil anymore. Use is_type_decl instead of dynamic_pointer_cast. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
95b12167fa
commit
09a24a4767
@ -11468,15 +11468,13 @@ string
|
|||||||
function_decl::parameter::get_pretty_representation(bool internal) const
|
function_decl::parameter::get_pretty_representation(bool internal) const
|
||||||
{
|
{
|
||||||
const environment* env = get_environment();
|
const environment* env = get_environment();
|
||||||
|
assert(env);
|
||||||
|
|
||||||
string type_repr;
|
string type_repr;
|
||||||
type_base_sptr t = get_type();
|
type_base_sptr t = get_type();
|
||||||
if (!t)
|
if (!t)
|
||||||
type_repr = "void";
|
type_repr = "void";
|
||||||
else if (env
|
else if (is_type_decl((env->get_variadic_parameter_type_decl())))
|
||||||
&& (t ==
|
|
||||||
dynamic_pointer_cast<type_base>
|
|
||||||
(env->get_variadic_parameter_type_decl())))
|
|
||||||
type_repr = "...";
|
type_repr = "...";
|
||||||
else
|
else
|
||||||
type_repr = ir::get_pretty_representation(t, internal);
|
type_repr = ir::get_pretty_representation(t, internal);
|
||||||
|
Loading…
Reference in New Issue
Block a user