summaryrefslogtreecommitdiffstats
path: root/src/abg-writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/abg-writer.cc')
-rw-r--r--src/abg-writer.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/abg-writer.cc b/src/abg-writer.cc
index c6869282..496f36a6 100644
--- a/src/abg-writer.cc
+++ b/src/abg-writer.cc
@@ -733,7 +733,7 @@ public:
733 /// @return true if the decl has already been emitted, false 733 /// @return true if the decl has already been emitted, false
734 /// otherwise. 734 /// otherwise.
735 bool 735 bool
736 decl_is_emitted(decl_base_sptr& decl) const 736 decl_is_emitted(const decl_base_sptr& decl) const
737 { 737 {
738 ABG_ASSERT(!is_type(decl)); 738 ABG_ASSERT(!is_type(decl));
739 string repr = get_pretty_representation(decl, true); 739 string repr = get_pretty_representation(decl, true);
@@ -2440,12 +2440,11 @@ write_translation_unit(write_context& ctxt,
2440 ctxt, indent + c.get_xml_element_indent()); 2440 ctxt, indent + c.get_xml_element_indent());
2441 2441
2442 typedef scope_decl::declarations declarations; 2442 typedef scope_decl::declarations declarations;
2443 typedef declarations::const_iterator const_iterator; 2443 const declarations& decls = tu.get_global_scope()->get_sorted_member_decls();
2444 const declarations& d = tu.get_global_scope()->get_sorted_member_decls();
2445 2444
2446 for (const_iterator i = d.begin(); i != d.end(); ++i) 2445 for (const decl_base_sptr& decl : decls)
2447 { 2446 {
2448 if (type_base_sptr t = is_type(*i)) 2447 if (type_base_sptr t = is_type(decl))
2449 { 2448 {
2450 // Emit declaration-only classes that are needed. Some of 2449 // Emit declaration-only classes that are needed. Some of
2451 // these classes can be empty. Those beasts can be classes 2450 // these classes can be empty. Those beasts can be classes
@@ -2456,13 +2455,12 @@ write_translation_unit(write_context& ctxt,
2456 && !ctxt.type_is_emitted(class_type)) 2455 && !ctxt.type_is_emitted(class_type))
2457 write_type(class_type, ctxt, 2456 write_type(class_type, ctxt,
2458 indent + c.get_xml_element_indent()); 2457 indent + c.get_xml_element_indent());
2459 continue;
2460 } 2458 }
2461 2459 else
2462 if (decl_base_sptr d = is_decl(*i)) 2460 {
2463 if (ctxt.decl_is_emitted(d)) 2461 if (!ctxt.decl_is_emitted(decl))
2464 continue; 2462 write_decl(decl, ctxt, indent + c.get_xml_element_indent());
2465 write_decl(*i, ctxt, indent + c.get_xml_element_indent()); 2463 }
2466 } 2464 }
2467 2465
2468 write_referenced_types(ctxt, tu, indent, is_last); 2466 write_referenced_types(ctxt, tu, indent, is_last);