From 32f202bddc9c93e6b11afed221d1fc6cdb195edf Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 28 Jan 2016 10:22:43 +0100 Subject: [PATCH] vhdlpp: VTypeRangeExpr::elaborate() --- vhdlpp/vtype.h | 4 ++-- vhdlpp/vtype_elaborate.cc | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/vhdlpp/vtype.h b/vhdlpp/vtype.h index b2212b6d6..800c0bbd3 100644 --- a/vhdlpp/vtype.h +++ b/vhdlpp/vtype.h @@ -282,7 +282,7 @@ class VTypeRange : public VType { // Get the type that is limited by the range. inline const VType*base_type() const { return base_; } - private: + protected: const VType*base_; }; @@ -295,7 +295,6 @@ class VTypeRangeConst : public VTypeRange { return new VTypeRangeConst(base_type()->clone(), start_, end_); } - public: // Virtual methods void write_to_stream(std::ostream&fd) const; private: @@ -309,6 +308,7 @@ class VTypeRangeExpr : public VTypeRange { ~VTypeRangeExpr(); VType*clone() const; + int elaborate(Entity*end, ScopeBase*scope) const; public: // Virtual methods void write_to_stream(std::ostream&fd) const; diff --git a/vhdlpp/vtype_elaborate.cc b/vhdlpp/vtype_elaborate.cc index b3b4cfd9d..e32d4d28e 100644 --- a/vhdlpp/vtype_elaborate.cc +++ b/vhdlpp/vtype_elaborate.cc @@ -29,7 +29,8 @@ int VType::elaborate(Entity*, ScopeBase*) const int VTypeArray::elaborate(Entity*ent, ScopeBase*scope) const { int errors = 0; - etype_->elaborate(ent, scope); + + errors += etype_->elaborate(ent, scope); for (vector::const_iterator cur = ranges_.begin() ; cur != ranges_.end() ; ++ cur) { @@ -43,3 +44,14 @@ int VTypeArray::elaborate(Entity*ent, ScopeBase*scope) const return errors; } + +int VTypeRangeExpr::elaborate(Entity*ent, ScopeBase*scope) const +{ + int errors = 0; + + errors += base_->elaborate(ent, scope); + errors += start_->elaborate_expr(ent, scope, 0); + errors += end_->elaborate_expr(ent, scope, 0); + + return errors; +}