]> sourceware.org Git - libabigail.git/commitdiff
Avoid emitting some empty translation units to abixml
authorDodji Seketeli <dodji@redhat.com>
Thu, 6 Apr 2017 10:31:35 +0000 (12:31 +0200)
committerDodji Seketeli <dodji@redhat.com>
Mon, 3 Jul 2017 15:45:39 +0000 (17:45 +0200)
It turned out a lot of empty translation unit can make it to the
abixml output.  This patch reduces the number of these.

* src/abg-writer.cc (write_corpus):  Do not emit a translation
unit that appears empty beforehand.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-writer.cc

index 716ff1ba4edf9fddc9b621fed274f06bf49c2159..297c56c731f5a5630e36c4f934f9945b61c29a2c 100644 (file)
@@ -3984,7 +3984,11 @@ write_corpus(const corpus_sptr   corpus,
         corpus->get_translation_units().begin();
        i != corpus->get_translation_units().end();
        ++i)
-    write_translation_unit(**i, ctxt, get_indent_to_level(ctxt, indent, 1));
+    {
+      translation_unit& tu = **i;
+      if (!tu.is_empty())
+       write_translation_unit(tu, ctxt, get_indent_to_level(ctxt, indent, 1));
+    }
 
   out << "</abi-corpus>\n";
 
This page took 0.042683 seconds and 5 git commands to generate.