From 5858e1bbacc4dbbdac7ff6e1ce39de15bf48215d Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 22 Jun 2015 14:03:59 +0200 Subject: [PATCH] vhdlpp: ExpName::probe_type() checks Subprogram parameters. --- vhdlpp/expression_elaborate.cc | 4 ++++ vhdlpp/scope.cc | 7 ++++++- vhdlpp/scope.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/vhdlpp/expression_elaborate.cc b/vhdlpp/expression_elaborate.cc index fd1814fcd..c2d334af2 100644 --- a/vhdlpp/expression_elaborate.cc +++ b/vhdlpp/expression_elaborate.cc @@ -940,6 +940,10 @@ const VType* ExpName::probe_type(Entity*ent, ScopeBase*scope) const return type; } + if (const InterfacePort*port = scope->find_param(name_)) { + return port->type; + } + if ((type = scope->is_enum_name(name_))) { return type; } diff --git a/vhdlpp/scope.cc b/vhdlpp/scope.cc index cb20fb9f8..d0a329514 100644 --- a/vhdlpp/scope.cc +++ b/vhdlpp/scope.cc @@ -158,7 +158,12 @@ Variable* ScopeBase::find_variable(perm_string by_name) const } } -const InterfacePort* ScopeBase::find_param(perm_string by_name) const +const InterfacePort* ScopeBase::find_param(perm_string) const +{ + return NULL; +} + +const InterfacePort* ScopeBase::find_param_all(perm_string by_name) const { for(map::const_iterator it = use_subprograms_.begin(); it != use_subprograms_.end(); ++it) { diff --git a/vhdlpp/scope.h b/vhdlpp/scope.h index 86990dc87..1f9ba26be 100644 --- a/vhdlpp/scope.h +++ b/vhdlpp/scope.h @@ -57,6 +57,7 @@ class ScopeBase { Signal* find_signal(perm_string by_name) const; Variable* find_variable(perm_string by_name) const; virtual const InterfacePort* find_param(perm_string by_name) const; + const InterfacePort* find_param_all(perm_string by_name) const; SubprogramHeader* find_subprogram(perm_string by_name) const; // Checks if a string is one of possible enum values. If so, the enum // type is returned, otherwise NULL.