]> sourceware.org Git - libabigail.git/commitdiff
Cleanup function_decl::parameter::get_pretty_representation
authorDodji Seketeli <dodji@redhat.com>
Fri, 10 Jun 2016 17:39:06 +0000 (19:39 +0200)
committerDodji Seketeli <dodji@redhat.com>
Mon, 13 Jun 2016 12:43:24 +0000 (14:43 +0200)
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>
src/abg-ir.cc

index 8193abe7fc45ed8fdd8a4e45241a1f7f529c9384..fbd655a28e20749a6570db4a588ce85b61fb6f6e 100644 (file)
@@ -11468,15 +11468,13 @@ string
 function_decl::parameter::get_pretty_representation(bool internal) const
 {
   const environment* env = get_environment();
+  assert(env);
 
   string type_repr;
   type_base_sptr t = get_type();
   if (!t)
     type_repr = "void";
-  else if (env
-          && (t ==
-              dynamic_pointer_cast<type_base>
-              (env->get_variadic_parameter_type_decl())))
+  else if (is_type_decl((env->get_variadic_parameter_type_decl())))
     type_repr = "...";
   else
     type_repr = ir::get_pretty_representation(t, internal);
This page took 0.057815 seconds and 5 git commands to generate.