aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/translate/trans-chap14.adb2
-rw-r--r--src/vhdl/translate/trans-chap2.adb6
-rw-r--r--src/vhdl/translate/trans-chap3.adb14
-rw-r--r--src/vhdl/translate/trans-chap7.adb16
-rw-r--r--src/vhdl/translate/trans-chap8.adb4
-rw-r--r--src/vhdl/translate/trans-chap9.adb13
-rw-r--r--src/vhdl/translate/trans.adb14
-rw-r--r--src/vhdl/translate/trans.ads10
-rw-r--r--src/vhdl/translate/translation.adb4
9 files changed, 41 insertions, 42 deletions
diff --git a/src/vhdl/translate/trans-chap14.adb b/src/vhdl/translate/trans-chap14.adb
index b35cc9f81..18c574578 100644
--- a/src/vhdl/translate/trans-chap14.adb
+++ b/src/vhdl/translate/trans-chap14.adb
@@ -340,7 +340,7 @@ package body Trans.Chap14 is
Chap6.Check_Bound_Error
(New_Compare_Op (ON_Eq,
New_Obj_Value (L),
- New_Lit (Get_Ortho_Expr (Get_Nth_Element (List, Limit))),
+ New_Lit (Get_Ortho_Literal (Get_Nth_Element (List, Limit))),
Ghdl_Bool_Type),
Attr, 0);
return New_Convert_Ov
diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb
index 374879857..91ea199aa 100644
--- a/src/vhdl/translate/trans-chap2.adb
+++ b/src/vhdl/translate/trans-chap2.adb
@@ -1283,10 +1283,10 @@ package body Trans.Chap2 is
Dest.all := (Kind => Kind_Index,
Mark => False,
Index_Field => Src.Index_Field);
- when Kind_Expr =>
- Dest.all := (Kind => Kind_Expr,
+ when Kind_Enum_Lit =>
+ Dest.all := (Kind => Kind_Enum_Lit,
Mark => False,
- Expr_Node => Src.Expr_Node);
+ Lit_Node => Src.Lit_Node);
when Kind_Package_Instance =>
Dest.all :=
(Kind => Kind_Package_Instance,
diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb
index 8b6ff6400..49cf89ec7 100644
--- a/src/vhdl/translate/trans-chap3.adb
+++ b/src/vhdl/translate/trans-chap3.adb
@@ -228,6 +228,14 @@ package body Trans.Chap3 is
-- Enumeration --
------------------
+ procedure Set_Ortho_Literal (Target : Iir; Expr : O_Cnode)
+ is
+ Info : Ortho_Info_Acc;
+ begin
+ Info := Add_Info (Target, Kind_Enum_Lit);
+ Info.Lit_Node := Expr;
+ end Set_Ortho_Literal;
+
function Translate_Enumeration_Literal (Lit : Iir_Enumeration_Literal)
return O_Ident
is
@@ -280,7 +288,7 @@ package body Trans.Chap3 is
Lit_Name := Translate_Enumeration_Literal (El);
New_Enum_Literal (Constr, Lit_Name, Val);
- Set_Ortho_Expr (El, Val);
+ Set_Ortho_Literal (El, Val);
end loop;
Finish_Enum_Type (Constr, Info.Ortho_Type (Mode_Value));
if Nbr <= 256 then
@@ -312,8 +320,8 @@ package body Trans.Chap3 is
Translate_Enumeration_Literal (False_Lit), False_Node,
Translate_Enumeration_Literal (True_Lit), True_Node);
Info.Type_Mode := Type_Mode_B1;
- Set_Ortho_Expr (False_Lit, False_Node);
- Set_Ortho_Expr (True_Lit, True_Node);
+ Set_Ortho_Literal (False_Lit, False_Node);
+ Set_Ortho_Literal (True_Lit, True_Node);
Info.S.Nocheck_Low := True;
Info.S.Nocheck_Hi := True;
Info.B.Align := Align_8;
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb
index 43268bad4..8e0f9aea3 100644
--- a/src/vhdl/translate/trans-chap7.adb
+++ b/src/vhdl/translate/trans-chap7.adb
@@ -179,7 +179,7 @@ package body Trans.Chap7 is
for I in 1 .. Len loop
Lit := Get_Nth_Element
(Literal_List, Natural (Str_Table.Element_String8 (Id, Pos32 (I))));
- New_Array_Aggr_El (List, Get_Ortho_Expr (Lit));
+ New_Array_Aggr_El (List, Get_Ortho_Literal (Lit));
end loop;
end Translate_Static_String_Literal8_Inner;
@@ -424,7 +424,7 @@ package body Trans.Chap7 is
for I in Img'Range loop
Lit := Get_Nth_Element (Literal_List, Character'Pos (Img (I)));
- New_Array_Aggr_El (List, Get_Ortho_Expr (Lit));
+ New_Array_Aggr_El (List, Get_Ortho_Literal (Lit));
end loop;
Finish_Array_Aggr (List, Res);
@@ -491,7 +491,7 @@ package body Trans.Chap7 is
Get_Enumeration_Literal_List (Get_Base_Type (Atype));
Enum : constant Iir := Get_Nth_Element (Lit_List, Pos);
begin
- return Get_Ortho_Expr (Enum);
+ return Get_Ortho_Literal (Enum);
end Translate_Enumeration_Literal;
function Translate_Numeric_Literal (Expr : Iir; Res_Type : O_Tnode)
@@ -1106,7 +1106,7 @@ package body Trans.Chap7 is
raise Internal_Error;
end case;
- V := Get_Ortho_Expr
+ V := Get_Ortho_Literal
(Get_Nth_Element (Get_Enumeration_Literal_List (Rtype), Val));
Start_If_Stmt (If_Blk,
New_Compare_Op (ON_Eq,
@@ -1974,7 +1974,7 @@ package body Trans.Chap7 is
end if;
Res := Create_Temp_Init (Get_Ortho_Type (Res_Type, Mode_Value),
- New_Lit (Get_Ortho_Expr (Init_Enum)));
+ New_Lit (Get_Ortho_Literal (Init_Enum)));
Open_Temp;
-- Translate the array. Note that Translate_Expression may create
@@ -2074,7 +2074,7 @@ package body Trans.Chap7 is
New_Compare_Op
(ON_Eq,
M2E (Val),
- New_Lit (Get_Ortho_Expr
+ New_Lit (Get_Ortho_Literal
(Get_Nth_Element (Enums, Boolean'Pos (Is_Rising)))),
Std_Boolean_Type_Node));
end Translate_Predefined_TF_Edge;
@@ -2326,7 +2326,7 @@ package body Trans.Chap7 is
when Iir_Predefined_Bit_Condition =>
return New_Compare_Op
- (ON_Eq, Left_Tree, New_Lit (Get_Ortho_Expr (Bit_1)),
+ (ON_Eq, Left_Tree, New_Lit (Get_Ortho_Literal (Bit_1)),
Std_Boolean_Type_Node);
when Iir_Predefined_Integer_Identity
@@ -5346,7 +5346,7 @@ package body Trans.Chap7 is
(Get_Base_Type (Get_Element_Subtype (Arr_Type)));
begin
Tmp := New_Lit
- (Get_Ortho_Expr (Get_Nth_Element (Enum_List, 0)));
+ (Get_Ortho_Literal (Get_Nth_Element (Enum_List, 0)));
end;
when Sh_Arith =>
Tmp := New_Obj_Value (Var_E);
diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb
index ef2f79d4f..82aec30a2 100644
--- a/src/vhdl/translate/trans-chap8.adb
+++ b/src/vhdl/translate/trans-chap8.adb
@@ -398,7 +398,7 @@ package body Trans.Chap8 is
raise Internal_Error;
end if;
V := New_Lit
- (Get_Ortho_Expr (Get_Nth_Element (List, Natural (Val))));
+ (Get_Ortho_Literal (Get_Nth_Element (List, Natural (Val))));
end;
when others =>
@@ -1095,7 +1095,7 @@ package body Trans.Chap8 is
end if;
Expr := Get_Severity_Expression (Stmt);
if Expr = Null_Iir then
- Severity := New_Lit (Get_Ortho_Expr (Level));
+ Severity := New_Lit (Get_Ortho_Literal (Level));
else
Severity := Chap7.Translate_Expression (Expr);
end if;
diff --git a/src/vhdl/translate/trans-chap9.adb b/src/vhdl/translate/trans-chap9.adb
index eb4668f7b..45068c733 100644
--- a/src/vhdl/translate/trans-chap9.adb
+++ b/src/vhdl/translate/trans-chap9.adb
@@ -387,7 +387,7 @@ package body Trans.Chap9 is
return New_Compare_Op
(ON_Eq,
Res,
- New_Lit (Get_Ortho_Expr (Bit_1)),
+ New_Lit (Get_Ortho_Literal (Bit_1)),
Get_Ortho_Type (Boolean_Type_Definition, Mode_Value));
elsif Rtype = Ieee.Std_Logic_1164.Std_Ulogic_Type then
return New_Value
@@ -482,7 +482,8 @@ package body Trans.Chap9 is
Start_Association (Assocs, Ghdl_Psl_Cover);
New_Association (Assocs, New_Obj_Value (Msg_Var));
- New_Association (Assocs, New_Lit (Get_Ortho_Expr (Severity_Level_Note)));
+ New_Association (Assocs, New_Lit (Get_Ortho_Literal
+ (Severity_Level_Note)));
New_Association (Assocs, New_Address (New_Obj (Loc),
Ghdl_Location_Ptr_Node));
New_Procedure_Call (Assocs);
@@ -491,10 +492,10 @@ package body Trans.Chap9 is
Start_Association (Assocs, Ghdl_Psl_Cover_Failed);
New_Association (Assocs, New_Obj_Value (Msg_Var));
- New_Association (Assocs,
- New_Lit (Get_Ortho_Expr (Severity_Level_Error)));
- New_Association (Assocs,
- New_Address (New_Obj (Loc), Ghdl_Location_Ptr_Node));
+ New_Association (Assocs, New_Lit (Get_Ortho_Literal
+ (Severity_Level_Error)));
+ New_Association (Assocs, New_Address (New_Obj (Loc),
+ Ghdl_Location_Ptr_Node));
New_Procedure_Call (Assocs);
Finish_If_Stmt (Blk);
diff --git a/src/vhdl/translate/trans.adb b/src/vhdl/translate/trans.adb
index 4d6a0a44a..fae8dd137 100644
--- a/src/vhdl/translate/trans.adb
+++ b/src/vhdl/translate/trans.adb
@@ -1422,18 +1422,10 @@ package body Trans is
Unchecked_Deallocation (Info);
end Free_Type_Info;
- procedure Set_Ortho_Expr (Target : Iir; Expr : O_Cnode)
- is
- Info : Ortho_Info_Acc;
- begin
- Info := Add_Info (Target, Kind_Expr);
- Info.Expr_Node := Expr;
- end Set_Ortho_Expr;
-
- function Get_Ortho_Expr (Target : Iir) return O_Cnode is
+ function Get_Ortho_Literal (Target : Iir) return O_Cnode is
begin
- return Get_Info (Target).Expr_Node;
- end Get_Ortho_Expr;
+ return Get_Info (Target).Lit_Node;
+ end Get_Ortho_Literal;
function Get_Ortho_Type (Target : Iir; Is_Sig : Object_Kind_Type)
return O_Tnode is
diff --git a/src/vhdl/translate/trans.ads b/src/vhdl/translate/trans.ads
index 8998e32c3..f9ec5f494 100644
--- a/src/vhdl/translate/trans.ads
+++ b/src/vhdl/translate/trans.ads
@@ -716,7 +716,7 @@ package Trans is
Kind_Type,
Kind_Incomplete_Type,
Kind_Index,
- Kind_Expr,
+ Kind_Enum_Lit,
Kind_Subprg,
Kind_Operator,
Kind_Call,
@@ -1435,10 +1435,10 @@ package Trans is
-- element (for unbounded element).
Field_Bound : O_Fnode := O_Fnode_Null;
- when Kind_Expr =>
+ when Kind_Enum_Lit =>
-- Ortho tree which represents the expression, used for
-- enumeration literals.
- Expr_Node : O_Cnode;
+ Lit_Node : O_Cnode;
when Kind_Subprg =>
-- True if the function can return a value stored in the secondary
@@ -1852,9 +1852,7 @@ package Trans is
procedure Free_Type_Info (Info : in out Type_Info_Acc);
- procedure Set_Ortho_Expr (Target : Iir; Expr : O_Cnode);
-
- function Get_Ortho_Expr (Target : Iir) return O_Cnode;
+ function Get_Ortho_Literal (Target : Iir) return O_Cnode;
function Get_Ortho_Type (Target : Iir; Is_Sig : Object_Kind_Type)
return O_Tnode;
diff --git a/src/vhdl/translate/translation.adb b/src/vhdl/translate/translation.adb
index 0999e792e..3aa021add 100644
--- a/src/vhdl/translate/translation.adb
+++ b/src/vhdl/translate/translation.adb
@@ -2025,8 +2025,8 @@ package body Translation is
-- We need this type very early, for predefined functions.
Std_Boolean_Type_Node :=
Get_Ortho_Type (Boolean_Type_Definition, Mode_Value);
- Std_Boolean_True_Node := Get_Ortho_Expr (Boolean_True);
- Std_Boolean_False_Node := Get_Ortho_Expr (Boolean_False);
+ Std_Boolean_True_Node := Get_Ortho_Literal (Boolean_True);
+ Std_Boolean_False_Node := Get_Ortho_Literal (Boolean_False);
Std_Boolean_Array_Type :=
New_Array_Type (Std_Boolean_Type_Node, Ghdl_Index_Type);