From 7b5470c8a7f91014155f68a85d01fe81daa6955c Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 29 Sep 2014 11:31:18 +0200 Subject: [PATCH] vhdlpp: Subprogram class inherits from ScopeBase. --- vhdlpp/architec_emit.cc | 1 + vhdlpp/debug.cc | 1 + vhdlpp/expression_emit.cc | 1 + vhdlpp/package.cc | 1 + vhdlpp/package_emit.cc | 1 + vhdlpp/scope.cc | 1 + vhdlpp/scope.h | 1 - vhdlpp/subprogram.h | 6 ++++-- 8 files changed, 10 insertions(+), 3 deletions(-) diff --git a/vhdlpp/architec_emit.cc b/vhdlpp/architec_emit.cc index 21d65b7f2..b6f47fc91 100644 --- a/vhdlpp/architec_emit.cc +++ b/vhdlpp/architec_emit.cc @@ -21,6 +21,7 @@ # include "entity.h" # include "expression.h" # include "sequential.h" +# include "subprogram.h" # include "vsignal.h" # include # include diff --git a/vhdlpp/debug.cc b/vhdlpp/debug.cc index f6152b94c..9a389d2ae 100644 --- a/vhdlpp/debug.cc +++ b/vhdlpp/debug.cc @@ -23,6 +23,7 @@ # include "architec.h" # include "expression.h" # include "parse_types.h" +# include "subprogram.h" # include "sequential.h" # include "vsignal.h" # include "vtype.h" diff --git a/vhdlpp/expression_emit.cc b/vhdlpp/expression_emit.cc index ac42aa94a..78f299b3a 100644 --- a/vhdlpp/expression_emit.cc +++ b/vhdlpp/expression_emit.cc @@ -22,6 +22,7 @@ # include "vtype.h" # include "architec.h" # include "package.h" +# include "subprogram.h" # include "parse_types.h" # include # include diff --git a/vhdlpp/package.cc b/vhdlpp/package.cc index 68c8acee1..e1a6c7de3 100644 --- a/vhdlpp/package.cc +++ b/vhdlpp/package.cc @@ -20,6 +20,7 @@ # include "package.h" # include "entity.h" +# include "subprogram.h" # include "parse_misc.h" # include "ivl_assert.h" diff --git a/vhdlpp/package_emit.cc b/vhdlpp/package_emit.cc index db302cbad..94a40c8c8 100644 --- a/vhdlpp/package_emit.cc +++ b/vhdlpp/package_emit.cc @@ -19,6 +19,7 @@ */ # include "package.h" +# include "subprogram.h" # include # include "ivl_assert.h" diff --git a/vhdlpp/scope.cc b/vhdlpp/scope.cc index b3fc8a5cc..e5d1dcd85 100644 --- a/vhdlpp/scope.cc +++ b/vhdlpp/scope.cc @@ -20,6 +20,7 @@ # include "scope.h" # include "package.h" +# include "subprogram.h" # include # include # include diff --git a/vhdlpp/scope.h b/vhdlpp/scope.h index ae2369b86..d0054dae4 100644 --- a/vhdlpp/scope.h +++ b/vhdlpp/scope.h @@ -26,7 +26,6 @@ # include "StringHeap.h" # include "entity.h" # include "expression.h" -# include "subprogram.h" # include "vsignal.h" class ActiveScope; diff --git a/vhdlpp/subprogram.h b/vhdlpp/subprogram.h index d48c94ac9..7af6c9e2f 100644 --- a/vhdlpp/subprogram.h +++ b/vhdlpp/subprogram.h @@ -22,15 +22,15 @@ # include "StringHeap.h" # include "LineInfo.h" +# include "scope.h" # include # include class InterfacePort; -class ScopeBase; class SequentialStmt; class VType; -class Subprogram : public LineInfo { +class Subprogram : public LineInfo, public ScopeBase { public: Subprogram(perm_string name, std::list*ports, @@ -48,6 +48,8 @@ class Subprogram : public LineInfo { // matches this subprogram and that subprogram. bool compare_specification(Subprogram*that) const; + int emit(ostream&out, Entity*ent, Architecture*arc); + // Emit a definition as it would show up in a package. int emit_package(std::ostream&fd) const;