diff options
| author | Tristan Gingold <tgingold@free.fr> | 2020-06-17 21:50:25 +0200 |
|---|---|---|
| committer | Tristan Gingold <tgingold@free.fr> | 2020-06-17 21:50:25 +0200 |
| commit | 473c83961abe4e2fb52c8812e46bf19a41fe52cf (patch) | |
| tree | 130b71c9e47b60837257ab7b104adf99d44152b8 /src/ortho/debug | |
| parent | 6581cce8c6ea51b5386156fa4d21bd8f1865f851 (diff) | |
| download | ghdl-473c83961abe4e2fb52c8812e46bf19a41fe52cf.tar.gz ghdl-473c83961abe4e2fb52c8812e46bf19a41fe52cf.tar.bz2 ghdl-473c83961abe4e2fb52c8812e46bf19a41fe52cf.zip | |
src/ortho: add new_convert.
Diffstat (limited to 'src/ortho/debug')
| -rw-r--r-- | src/ortho/debug/ortho_debug-disp.adb | 7 | ||||
| -rw-r--r-- | src/ortho/debug/ortho_debug.adb | 24 | ||||
| -rw-r--r-- | src/ortho/debug/ortho_debug.private.ads | 4 |
3 files changed, 29 insertions, 6 deletions
diff --git a/src/ortho/debug/ortho_debug-disp.adb b/src/ortho/debug/ortho_debug-disp.adb index 465de8f7e..a7bbbe907 100644 --- a/src/ortho/debug/ortho_debug-disp.adb +++ b/src/ortho/debug/ortho_debug-disp.adb @@ -366,6 +366,8 @@ package body Ortho_Debug.Disp is return "function call"; when OE_Convert_Ov => return "convert_ov"; + when OE_Convert => + return "convert"; when OE_Address => return "address"; when OE_Unchecked_Address => @@ -755,6 +757,11 @@ package body Ortho_Debug.Disp is Put (")"); when OE_Convert_Ov => Disp_Tnode_Name (E.Rtype); + Put ("'conv# ("); + Disp_Enode (E.Conv, O_Tnode_Null); + Put (')'); + when OE_Convert => + Disp_Tnode_Name (E.Rtype); Put ("'conv ("); Disp_Enode (E.Conv, O_Tnode_Null); Put (')'); diff --git a/src/ortho/debug/ortho_debug.adb b/src/ortho/debug/ortho_debug.adb index 30a9478ef..a4c5bc578 100644 --- a/src/ortho/debug/ortho_debug.adb +++ b/src/ortho/debug/ortho_debug.adb @@ -1094,20 +1094,34 @@ package body Ortho_Debug is function New_Convert_Ov (Val : O_Enode; Rtype : O_Tnode) return O_Enode is - subtype O_Enode_Convert is O_Enode_Type (OE_Convert_Ov); Res : O_Enode; begin Check_Ref (Val); if not Check_Conv (Val.Rtype.Kind, Rtype.Kind) then raise Type_Error; end if; - Res := new O_Enode_Convert'(Kind => OE_Convert_Ov, - Rtype => Rtype, - Ref => False, - Conv => Val); + Res := new O_Enode_Type'(Kind => OE_Convert_Ov, + Rtype => Rtype, + Ref => False, + Conv => Val); return Res; end New_Convert_Ov; + function New_Convert (Val : O_Enode; Rtype : O_Tnode) return O_Enode + is + Res : O_Enode; + begin + Check_Ref (Val); + if not Check_Conv (Val.Rtype.Kind, Rtype.Kind) then + raise Type_Error; + end if; + Res := new O_Enode_Type'(Kind => OE_Convert, + Rtype => Rtype, + Ref => False, + Conv => Val); + return Res; + end New_Convert; + function New_Unchecked_Address (Lvalue : O_Lnode; Atype : O_Tnode) return O_Enode is diff --git a/src/ortho/debug/ortho_debug.private.ads b/src/ortho/debug/ortho_debug.private.ads index 7586319ff..0bf91f106 100644 --- a/src/ortho/debug/ortho_debug.private.ads +++ b/src/ortho/debug/ortho_debug.private.ads @@ -227,6 +227,7 @@ private -- Misc. OE_Convert_Ov, + OE_Convert, OE_Address, OE_Unchecked_Address, OE_Alloca, @@ -261,7 +262,8 @@ private when OE_Address | OE_Unchecked_Address => Lvalue : O_Lnode; - when OE_Convert_Ov => + when OE_Convert_Ov + | OE_Convert => Conv : O_Enode; when OE_Function_Call => Func : O_Dnode; |
