From 0b8a16ef393eebc18e51b4c1f3127f61aaf97c9d Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Thu, 29 Aug 2013 16:42:22 +0200 Subject: [PATCH] Define translation_unit{_sptr,s} types in abigail:: * include/abg-corpus.h (abigail::corpus::{translation_unit_sptr, translation_units): Do not define these typedefs here. Rather) (define them ... * include/abg-ir.h (abigail::{translation_units,translation_unit_sptr): ... here. This is because a translation unit can be manipulated independently from an abi corpus. * src/abg-corpus.cc (corpus::get_translation_units): Adjust return type to comply with the change above. Signed-off-by: Dodji Seketeli --- include/abg-corpus.h | 6 ++---- include/abg-ir.h | 3 +++ src/abg-corpus.cc | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/abg-corpus.h b/include/abg-corpus.h index b3364d67..eac022a2 100644 --- a/include/abg-corpus.h +++ b/include/abg-corpus.h @@ -36,10 +36,8 @@ namespace abigail class corpus { public: - struct impl; - typedef std::string string; - typedef shared_ptr translation_unit_sptr; - typedef std::vector translation_units; + struct impl; + typedef std::string string; private: shared_ptr m_priv; diff --git a/include/abg-ir.h b/include/abg-ir.h index a5ac0a02..60fc6d42 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -164,6 +164,9 @@ public: traverse(ir_node_visitor& v); };//end class translation_unit +typedef shared_ptr translation_unit_sptr; +typedef std::vector translation_units; + /// The base type of all declarations. class decl_base : public traversable_base { diff --git a/src/abg-corpus.cc b/src/abg-corpus.cc index cf31cba8..710e16c3 100644 --- a/src/abg-corpus.cc +++ b/src/abg-corpus.cc @@ -214,7 +214,7 @@ struct corpus::impl /// Return the list of translation units of the current corpus. /// /// @return the list of translation units of the current corpus. - const corpus::translation_units& + const translation_units& corpus::get_translation_units() const { return m_priv->members;