summaryrefslogtreecommitdiff
path: root/src/ortho/mcode/ortho_code-consts.adb
diff options
context:
space:
mode:
authorTristan Gingold2016-01-05 06:44:53 +0100
committerTristan Gingold2016-01-06 18:38:37 +0100
commitb5797a5cef6d25817da7998f6263afa53e196d25 (patch)
treead3b67a93d16e8a06fab2d7a8c4d8993ff101b8a /src/ortho/mcode/ortho_code-consts.adb
parent955e964b024de556c4c0db8fd745c6abdb8052fe (diff)
downloadghdl-b5797a5cef6d25817da7998f6263afa53e196d25.tar.gz
ghdl-b5797a5cef6d25817da7998f6263afa53e196d25.tar.bz2
ghdl-b5797a5cef6d25817da7998f6263afa53e196d25.zip
mcode: add support for x86-64
Diffstat (limited to 'src/ortho/mcode/ortho_code-consts.adb')
-rw-r--r--src/ortho/mcode/ortho_code-consts.adb15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/ortho/mcode/ortho_code-consts.adb b/src/ortho/mcode/ortho_code-consts.adb
index 6e36a07..4522e67 100644
--- a/src/ortho/mcode/ortho_code-consts.adb
+++ b/src/ortho/mcode/ortho_code-consts.adb
@@ -363,32 +363,33 @@ package body Ortho_Code.Consts is
procedure Start_Array_Aggr (List : out O_Array_Aggr_List; Atype : O_Tnode)
is
+ Num : constant Uns32 := Get_Type_Subarray_Length (Atype);
Val : Int32;
- Num : Uns32;
begin
- Num := Get_Type_Subarray_Length (Atype);
Val := Els.Allocate (Integer (Num));
Cnodes.Append (Cnode_Common'(Kind => OC_Array,
Lit_Type => Atype));
List := (Res => Cnodes.Last,
- El => Val);
+ El => Val,
+ Len => Num);
Cnodes.Append (To_Cnode_Common (Cnode_Aggr'(Els => Val,
Nbr => Int32 (Num))));
end Start_Array_Aggr;
procedure New_Array_Aggr_El (List : in out O_Array_Aggr_List;
- Value : O_Cnode)
- is
+ Value : O_Cnode) is
begin
+ pragma Assert (List.Len > 0);
+ List.Len := List.Len - 1;
Els.Table (List.El) := Value;
List.El := List.El + 1;
end New_Array_Aggr_El;
procedure Finish_Array_Aggr (List : in out O_Array_Aggr_List;
- Res : out O_Cnode)
- is
+ Res : out O_Cnode) is
begin
+ pragma Assert (List.Len = 0);
Res := List.Res;
end Finish_Array_Aggr;