aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/mcode
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-02-21 06:52:07 +0100
committerTristan Gingold <tgingold@free.fr>2016-02-21 11:47:12 +0100
commit405df8e149b7273123ee99e51719f31913248469 (patch)
tree9cc89ce3841957634dfe870648bc21d52a59fd61 /src/ortho/mcode
parent122e8753c6218a0adfb8b2a7aef7dd424eb6562a (diff)
downloadghdl-405df8e149b7273123ee99e51719f31913248469.tar.gz
ghdl-405df8e149b7273123ee99e51719f31913248469.tar.bz2
ghdl-405df8e149b7273123ee99e51719f31913248469.zip
ortho: rename start/finish_const_value to start/finish_init_value.
Diffstat (limited to 'src/ortho/mcode')
-rw-r--r--src/ortho/mcode/ortho_code-decls.adb18
-rw-r--r--src/ortho/mcode/ortho_code-decls.ads4
-rw-r--r--src/ortho/mcode/ortho_mcode.adb14
-rw-r--r--src/ortho/mcode/ortho_mcode.ads14
-rw-r--r--src/ortho/mcode/ortho_mcode.private.ads4
5 files changed, 24 insertions, 30 deletions
diff --git a/src/ortho/mcode/ortho_code-decls.adb b/src/ortho/mcode/ortho_code-decls.adb
index b95d4a2b8..a3a5e5eb0 100644
--- a/src/ortho/mcode/ortho_code-decls.adb
+++ b/src/ortho/mcode/ortho_code-decls.adb
@@ -345,6 +345,8 @@ package body Ortho_Code.Decls is
procedure New_Init_Value (Decl : O_Dnode; Val : O_Cnode) is
begin
+ pragma Assert (Get_Decl_Kind (Decl) = OD_Const
+ or else Get_Decl_Kind (Decl) = OD_Var);
if Get_Init_Value (Decl) /= O_Cnode_Null then
-- Value was already set.
raise Syntax_Error;
@@ -363,18 +365,10 @@ package body Ortho_Code.Decls is
end if;
end New_Init_Value;
- procedure New_Const_Value (Cst : O_Dnode; Val : O_Cnode) is
- begin
- pragma Assert (Get_Decl_Kind (Cst) = OD_Const);
- New_Init_Value (Cst, Val);
- end New_Const_Value;
-
- procedure New_Var_Decl
- (Res : out O_Dnode;
- Ident : O_Ident;
- Storage : O_Storage;
- Atype : O_Tnode)
- is
+ procedure New_Var_Decl (Res : out O_Dnode;
+ Ident : O_Ident;
+ Storage : O_Storage;
+ Atype : O_Tnode) is
begin
if Storage = O_Storage_Local then
Dnodes.Append (Dnode_Common'(Kind => OD_Local,
diff --git a/src/ortho/mcode/ortho_code-decls.ads b/src/ortho/mcode/ortho_code-decls.ads
index 0cd532593..70a0ba4df 100644
--- a/src/ortho/mcode/ortho_code-decls.ads
+++ b/src/ortho/mcode/ortho_code-decls.ads
@@ -132,8 +132,8 @@ package Ortho_Code.Decls is
Storage : O_Storage;
Atype : O_Tnode);
- -- Set the value to CST.
- procedure New_Const_Value (Cst : O_Dnode; Val : O_Cnode);
+ -- Set the value to DECL.
+ procedure New_Init_Value (Decl : O_Dnode; Val : O_Cnode);
-- Create a variable declaration.
-- A variable can be local only inside a function.
diff --git a/src/ortho/mcode/ortho_mcode.adb b/src/ortho/mcode/ortho_mcode.adb
index 77e101721..cb2ab6663 100644
--- a/src/ortho/mcode/ortho_mcode.adb
+++ b/src/ortho/mcode/ortho_mcode.adb
@@ -29,12 +29,12 @@ package body Ortho_Mcode is
null;
end New_Debug_Comment_Stmt;
- procedure Start_Const_Value (Const : in out O_Dnode)
+ procedure Start_Init_Value (Decl : in out O_Dnode)
is
- pragma Unreferenced (Const);
+ pragma Unreferenced (Decl);
begin
null;
- end Start_Const_Value;
+ end Start_Init_Value;
procedure Start_Record_Type (Elements : out O_Element_List) is
begin
@@ -112,12 +112,12 @@ package body Ortho_Mcode is
Ortho_Code.O_Tnode (Dtype));
end Finish_Access_Type;
- procedure Finish_Const_Value (Const : in out O_Dnode; Val : O_Cnode)
+ procedure Finish_Init_Value (Decl : in out O_Dnode; Val : O_Cnode)
is
- pragma Warnings (Off, Const);
+ pragma Warnings (Off, Decl);
begin
- New_Const_Value (Ortho_Code.O_Dnode (Const), Ortho_Code.O_Cnode (Val));
- end Finish_Const_Value;
+ New_Init_Value (Ortho_Code.O_Dnode (Decl), Ortho_Code.O_Cnode (Val));
+ end Finish_Init_Value;
function New_Array_Type (El_Type : O_Tnode; Index_Type : O_Tnode)
return O_Tnode is
diff --git a/src/ortho/mcode/ortho_mcode.ads b/src/ortho/mcode/ortho_mcode.ads
index 45e803690..ec65fab5c 100644
--- a/src/ortho/mcode/ortho_mcode.ads
+++ b/src/ortho/mcode/ortho_mcode.ads
@@ -297,8 +297,8 @@ package Ortho_Mcode is
function New_Slice (Arr : O_Lnode; Res_Type : O_Tnode; Index : O_Enode)
return O_Lnode;
- -- Get an element of a record.
- -- Type of REC must be a record type.
+ -- Get an element of a record or a union.
+ -- Type of REC must be a record or a union type.
function New_Selected_Element (Rec : O_Lnode; El : O_Fnode)
return O_Lnode;
@@ -357,9 +357,9 @@ package Ortho_Mcode is
Storage : O_Storage;
Atype : O_Tnode);
- -- Set the value of a non-external constant.
- procedure Start_Const_Value (Const : in out O_Dnode);
- procedure Finish_Const_Value (Const : in out O_Dnode; Val : O_Cnode);
+ -- Set the value of a non-external constant or variable.
+ procedure Start_Init_Value (Decl : in out O_Dnode);
+ procedure Finish_Init_Value (Decl : in out O_Dnode; Val : O_Cnode);
-- Create a variable declaration.
-- A variable can be local only inside a function.
@@ -538,8 +538,8 @@ private
pragma Inline (New_Type_Decl);
pragma Inline (New_Const_Decl);
- pragma Inline (Start_Const_Value);
- pragma Inline (Finish_Const_Value);
+ pragma Inline (Start_Init_Value);
+ pragma Inline (Finish_Init_Value);
pragma Inline (New_Var_Decl);
pragma Inline (New_Obj);
diff --git a/src/ortho/mcode/ortho_mcode.private.ads b/src/ortho/mcode/ortho_mcode.private.ads
index 1b414773f..5374ae978 100644
--- a/src/ortho/mcode/ortho_mcode.private.ads
+++ b/src/ortho/mcode/ortho_mcode.private.ads
@@ -106,8 +106,8 @@ private
pragma Inline (New_Type_Decl);
pragma Inline (New_Const_Decl);
- pragma Inline (Start_Const_Value);
- pragma Inline (Finish_Const_Value);
+ pragma Inline (Start_Init_Value);
+ pragma Inline (Finish_Init_Value);
pragma Inline (New_Var_Decl);
pragma Inline (New_Obj);