aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-05-12 05:19:08 +0200
committerTristan Gingold <tgingold@free.fr>2017-05-12 05:20:51 +0200
commit67ec6bde36b1c48d9b226ba93a8552c5ca8830c2 (patch)
tree2e9688291fe38e4c356968ef2d8f722bd19ba4d8
parent6714b56ddc9c5011bf404102e57c702e003a561b (diff)
downloadghdl-67ec6bde36b1c48d9b226ba93a8552c5ca8830c2.tar.gz
ghdl-67ec6bde36b1c48d9b226ba93a8552c5ca8830c2.tar.bz2
ghdl-67ec6bde36b1c48d9b226ba93a8552c5ca8830c2.zip
sem_inst: remove assert that prevented nested instantiation.
-rw-r--r--src/vhdl/sem_inst.adb12
-rw-r--r--src/vhdl/translate/trans-chap8.adb1
2 files changed, 8 insertions, 5 deletions
diff --git a/src/vhdl/sem_inst.adb b/src/vhdl/sem_inst.adb
index a746822ff..2d39396f0 100644
--- a/src/vhdl/sem_inst.adb
+++ b/src/vhdl/sem_inst.adb
@@ -105,10 +105,10 @@ package body Sem_Inst is
-- table is to be able to revert the calls to Set_Instance, so that a unit
-- can be instantiated several times. Keeping the nodes that have been
-- instantiated is cheaper than walking the tree a second time.
- -- The second purpose of this table is not yet implemented: being able to
- -- have uninstantiated packages in instantiated packages. In that case,
- -- the slot in Origin_Table cannot be the origin and the instance at the
- -- same time.
+ -- The second purpose of this table is to be able to have uninstantiated
+ -- packages in instantiated packages. In that case, the slot in
+ -- Origin_Table cannot be the origin and the instance at the same time and
+ -- has to be saved.
package Prev_Instance_Table is new Tables
(Table_Component_Type => Instance_Entry_Type,
Table_Index_Type => Instance_Index_Type,
@@ -368,7 +368,9 @@ package body Sem_Inst is
return Res;
end if;
- pragma Assert (Res = Null_Iir);
+ -- RES is null_iir unless RES is also an instance (and therefore has
+ -- an origin).
+ -- pragma Assert (Res = Null_Iir);
-- Create a new node.
Res := Create_Iir (Kind);
diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb
index d32483348..2da9d8e00 100644
--- a/src/vhdl/translate/trans-chap8.adb
+++ b/src/vhdl/translate/trans-chap8.adb
@@ -2559,6 +2559,7 @@ package body Trans.Chap8 is
if Is_Function and then Info.Res_Interface /= O_Dnode_Null then
-- Composite result.
-- If we need to allocate, do it before starting the call!
+ -- TODO: could be eliminated if the value is also returned (RVO).
declare
Res_Type : constant Iir := Get_Return_Type (Imp);
Res_Info : constant Type_Info_Acc := Get_Info (Res_Type);