Misc style fixes
authorDodji Seketeli <dodji@redhat.com>
Thu, 5 Jan 2017 09:58:14 +0000 (10:58 +0100)
committerDodji Seketeli <dodji@redhat.com>
Thu, 5 Jan 2017 11:51:30 +0000 (12:51 +0100)
* include/abg-corpus.h: Remove corpus_sptr typedef. It's in
abg-fwd.h now.
* src/abg-ir.cc: Remove some unnecessary vertical space.
* src/abg-reader.cc (build_function_decl): Cleanup some asserts.
* src/abg-writer.cc (write_function_type): Each the inspection of
the type id from within the debugger.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-corpus.h
src/abg-ir.cc
src/abg-reader.cc
src/abg-writer.cc
tools/abicompat.cc

index 54279e488113fa95fc6e5c2ffca530d56c627696..7d631dd15f544e11be2962eed2b663fed3675e60 100644 (file)
@@ -31,10 +31,6 @@ namespace abigail
 namespace ir
 {
 
-class corpus;
-/// A convenience typedef for shared pointer to @ref corpus.
-typedef shared_ptr<corpus> corpus_sptr;
-
 /// This is the abstraction of a set of translation units (themselves
 /// seen as bundles of unitary abi artefacts like types and decls)
 /// bundled together as a corpus.  A corpus is thus the Application
index 5ca61d6451a2715ca37f17c99d712b48aab4d3c4..939df912337f22a14aa18c3f33cecfb7c4f1d580 100644 (file)
@@ -6902,7 +6902,6 @@ decl_base_sptr
 convert_node_to_decl(class_decl_sptr node)
 {return node;}
 
-
 /// Get the declaration of a type_base node.
 ///
 /// @param node the type node to consider.
index c715b114fb99045e39686dd1a491c621b04619e9..b21397b3abea7c2f8f5f207cd010b922b8f8aae6 100644 (file)
@@ -2714,8 +2714,6 @@ build_function_decl(read_context& ctxt,
        }
     }
 
-  assert(return_type);
-
   function_type_sptr fn_type(as_method_decl
                             ? new method_type(return_type, as_method_decl,
                                               parms, /*is_const=*/false,
@@ -2723,6 +2721,8 @@ build_function_decl(read_context& ctxt,
                             : new function_type(return_type,
                                                 parms, size, align));
 
+  assert(fn_type);
+
   function_decl_sptr fn_decl(as_method_decl
                             ? new method_decl (name, fn_type,
                                                declared_inline, loc,
index f26e2354b1c3bef045eee15935c44681e890af8c..de14d09c411521e84bbd901de77e5b102e6759df 100644 (file)
@@ -2410,8 +2410,10 @@ write_function_type(const function_type_sptr& fn_type,
                               /*is_static=*/false, o);
     }
 
+  interned_string id = ctxt.get_id_for_type(fn_type);
+
   o << " id='"
-    << ctxt.get_id_for_type(fn_type) << "'";
+    <<  id << "'";
   o << ">\n";
 
   type_base_sptr parm_type;
index b404335b23c418349fb84cf9c06f5ef7544d8aee..6d337a48b84411799d4166107e2334ce5b9b8032 100644 (file)
@@ -488,6 +488,7 @@ perform_compat_check_in_weak_mode(options& opts,
       string id = (*i)->get_id_string();
       lib_corpus->get_sym_ids_of_fns_to_keep().push_back(id);
     }
+
   for (elf_symbols::const_iterator i =
         app_corpus->get_sorted_undefined_var_symbols().begin();
        i != app_corpus->get_sorted_undefined_var_symbols().end();