aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-10-01 07:26:51 +0200
committerTristan Gingold <tgingold@free.fr>2016-10-01 07:26:51 +0200
commit5aa2650481c681e40f5d20997cd90f56ae0cdcd0 (patch)
treea3887b81c40e02e673e60d3d5795d03ae2bfc930
parentfa1727c1ce8cf56069e853c780adc39beee8fc71 (diff)
downloadghdl-5aa2650481c681e40f5d20997cd90f56ae0cdcd0.tar.gz
ghdl-5aa2650481c681e40f5d20997cd90f56ae0cdcd0.tar.bz2
ghdl-5aa2650481c681e40f5d20997cd90f56ae0cdcd0.zip
Revive node_gc, avoid copy of enumeration in enumeration range.
-rw-r--r--src/vhdl/iirs_utils.adb8
-rw-r--r--src/vhdl/nodes_gc.adb10
-rw-r--r--src/vhdl/std_package.adb4
-rw-r--r--src/vhdl/std_package.ads3
4 files changed, 11 insertions, 14 deletions
diff --git a/src/vhdl/iirs_utils.adb b/src/vhdl/iirs_utils.adb
index 8cac2f33a..777965cd0 100644
--- a/src/vhdl/iirs_utils.adb
+++ b/src/vhdl/iirs_utils.adb
@@ -591,12 +591,8 @@ package body Iirs_Utils is
Location_Copy (Range_Expr, Def);
Set_Type (Range_Expr, Def);
Set_Direction (Range_Expr, Iir_To);
- Set_Left_Limit
- (Range_Expr,
- Copy_Enumeration_Literal (Get_First_Element (Literal_List)));
- Set_Right_Limit
- (Range_Expr,
- Copy_Enumeration_Literal (Get_Last_Element (Literal_List)));
+ Set_Left_Limit (Range_Expr, Get_First_Element (Literal_List));
+ Set_Right_Limit (Range_Expr, Get_Last_Element (Literal_List));
Set_Expr_Staticness (Range_Expr, Locally);
Set_Range_Constraint (Def, Range_Expr);
end Create_Range_Constraint_For_Enumeration_Type;
diff --git a/src/vhdl/nodes_gc.adb b/src/vhdl/nodes_gc.adb
index d400d8f50..81c8eb3e3 100644
--- a/src/vhdl/nodes_gc.adb
+++ b/src/vhdl/nodes_gc.adb
@@ -87,13 +87,6 @@ package body Nodes_GC is
-- Anonymous interfaces are shared by predefined functions.
return;
end if;
- when Iir_Kind_Enumeration_Literal =>
- if Get_Enum_Pos (N) = 0
- or else N = Get_Right_Limit (Get_Range_Constraint
- (Get_Type (N)))
- then
- return;
- end if;
when others =>
null;
end case;
@@ -160,7 +153,7 @@ package body Nodes_GC is
null;
end case;
when Attr_Of_Ref =>
- raise Internal_Error;
+ null;
end case;
end loop;
end;
@@ -186,6 +179,7 @@ package body Nodes_GC is
Mark_Iir (Convertible_Real_Type_Declaration);
Mark_Iir (Universal_Integer_One);
Mark_Iir (Error_Mark);
+ Mark_Chain (Wildcard_Type_Declaration_Chain);
El := Error_Mark;
Nbr_Unreferenced := 0;
diff --git a/src/vhdl/std_package.adb b/src/vhdl/std_package.adb
index 8143d9c63..93cee8045 100644
--- a/src/vhdl/std_package.adb
+++ b/src/vhdl/std_package.adb
@@ -353,6 +353,9 @@ package body Std_Package is
Set_Type_Staticness (Def, None);
Set_Type_Definition (Decl, Def);
Set_Type_Declarator (Def, Decl);
+
+ Set_Chain (Decl, Wildcard_Type_Declaration_Chain);
+ Wildcard_Type_Declaration_Chain := Decl;
end Create_Wildcard_Type;
begin
@@ -1209,6 +1212,7 @@ package body Std_Package is
-- Wilcard types.
-- Create the declaration and give them meaningful (and invalid) names
-- so that error messages are clear for the user.
+ Wildcard_Type_Declaration_Chain := Null_Iir;
Create_Wildcard_Type (Wildcard_Any_Type, "any type");
Create_Wildcard_Type (Wildcard_Any_Aggregate_Type, "any aggregate type");
Create_Wildcard_Type (Wildcard_Any_String_Type, "any string type");
diff --git a/src/vhdl/std_package.ads b/src/vhdl/std_package.ads
index 9ee4ca41f..e655cb181 100644
--- a/src/vhdl/std_package.ads
+++ b/src/vhdl/std_package.ads
@@ -172,6 +172,9 @@ package Std_Package is
-- at compilation time.
subtype Iir_Wildcard_Types is Iir range 7 .. 10;
+ -- Chain of wildcard declarations, to own the nodes.
+ Wildcard_Type_Declaration_Chain : Iir;
+
-- Create the first well-known nodes.
procedure Create_First_Nodes;