diff --git a/src/abg-ir.cc b/src/abg-ir.cc index d5b3a573..1dabbf7d 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -136,47 +136,28 @@ location_manager::expand_location(const location location, // decl_base::decl_base() - : m_kind(KIND_DECL) { } decl_base::decl_base(const std::string& name, location locus) - :m_kind(KIND_DECL), - m_location(locus), - m_name(name) -{ -} - -decl_base::decl_base(kind what_kind, - const std::string& name, - location locus) - : m_kind(what_kind), - m_location(locus), + : m_location(locus), m_name(name) { } decl_base::decl_base(location l) - :m_kind(KIND_DECL), - m_location(l) + : m_location(l) { } decl_base::decl_base(const decl_base& d) { - m_kind = d.m_kind; m_location = d.m_location; m_name = d.m_name; m_context = d.m_context; } -enum decl_base::kind -decl_base::what_kind () const -{ - return m_kind; -} - decl_base::~decl_base() { } @@ -192,19 +173,13 @@ decl_base::set_scope(shared_ptr scope) // scope_decl::scope_decl(const std::string& name, location locus) - : decl_base(KIND_SCOPE_DECL, name, locus) + : decl_base(name, locus) { } -scope_decl::scope_decl(kind akind, - const std::string& name, - location locus) - : decl_base(akind, name, locus) -{ -} scope_decl::scope_decl(location l) - : decl_base(KIND_SCOPE_DECL, "", l) + : decl_base("", l) { } @@ -289,21 +264,11 @@ type_decl::type_decl(const std::string& name, size_t size_in_bits, size_t alignment_in_bits, location locus) - : decl_base(KIND_TYPE_DECL, name, locus), + : decl_base(name, locus), type_base(size_in_bits, alignment_in_bits) { } -type_decl::type_decl(kind akind, - const std::string& name, - size_t size_in_bits, - size_t alignment_in_bits, - location locus) - : decl_base(akind, name, locus), - type_base(size_in_bits, alignment_in_bits) -{ -} - type_decl::~type_decl() { } @@ -316,21 +281,11 @@ scope_type_decl::scope_type_decl(const std::string& name, size_t size_in_bits, size_t alignment_in_bits, location locus) - :scope_decl(KIND_SCOPE_TYPE_DECL, name, locus), + :scope_decl(name, locus), type_base(size_in_bits, alignment_in_bits) { } -scope_type_decl::scope_type_decl(kind akind, - const std::string& name, - size_t size_in_bits, - size_t alignment_in_bits, - location locus) - : scope_decl(akind, name, locus), - type_base(size_in_bits, alignment_in_bits) -{ -} - scope_type_decl::~scope_type_decl() { } @@ -340,7 +295,7 @@ scope_type_decl::~scope_type_decl() // namespace_decl::namespace_decl(const std::string& name, location locus) - : scope_decl(KIND_NAMESPACE_DECL, name, locus) + : scope_decl(name, locus) { } diff --git a/src/abg-ir.h b/src/abg-ir.h index 333fe12c..fb4a9770 100644 --- a/src/abg-ir.h +++ b/src/abg-ir.h @@ -95,26 +95,6 @@ class decl_base void set_scope(shared_ptr); -public: - - enum kind - { - KIND_DECL, - KIND_SCOPE_DECL, - KIND_TYPE_DECL, - KIND_SCOPE_TYPE_DECL, - KIND_NAMESPACE_DECL - }; - - enum kind - what_kind () const; - -protected: - - decl_base(kind what_kind, - const std::string& name, - location locus); - public: decl_base(const std::string& name, @@ -157,7 +137,6 @@ public: add_decl_to_scope(shared_ptr, shared_ptr); private: - kind m_kind; location m_location; std::string m_name; shared_ptr m_context; @@ -171,11 +150,6 @@ class scope_decl : public decl_base void add_member_decl(const shared_ptr); -protected: - scope_decl(kind akind, - const std::string& name, - location locus); - public: scope_decl(const std::string& name, location locus); @@ -249,14 +223,6 @@ class type_decl : public decl_base, public type_base // Forbidden. type_decl(); -protected: - - type_decl(kind akind, - const std::string& name, - size_t size_in_bits, - size_t alignment_in_bits, - location locus); - public: type_decl(const std::string& name, @@ -290,13 +256,6 @@ class scope_type_decl : public scope_decl, public type_base { scope_type_decl(); -protected: - - scope_type_decl(kind akind, - const std::string& name, - size_t size_in_bits, - size_t alignment_in_bits, - location locus); public: scope_type_decl(const std::string& name,