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:
Dodji Seketeli 2016-06-10 19:39:06 +02:00
parent 95b12167fa
commit 09a24a4767

View File

@ -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);