diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-02-21 07:56:25 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-03-08 06:25:52 +0100 |
commit | 77f983ae738583dfce7c3c3aaab5efde16519af0 (patch) | |
tree | d7f17de16b115bfc3ff52ad0f6b04e840800dae8 /src/ortho/debug | |
parent | a7bb5f6944b410d2b02b1ae5aa9fdc10c68d7519 (diff) | |
download | ghdl-77f983ae738583dfce7c3c3aaab5efde16519af0.tar.gz ghdl-77f983ae738583dfce7c3c3aaab5efde16519af0.tar.bz2 ghdl-77f983ae738583dfce7c3c3aaab5efde16519af0.zip |
ortho: add new_default_value to initialize a variable.
Diffstat (limited to 'src/ortho/debug')
-rw-r--r-- | src/ortho/debug/ortho_debug-disp.adb | 6 | ||||
-rw-r--r-- | src/ortho/debug/ortho_debug.adb | 11 | ||||
-rw-r--r-- | src/ortho/debug/ortho_debug.private.ads | 3 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/ortho/debug/ortho_debug-disp.adb b/src/ortho/debug/ortho_debug-disp.adb index 145a4c5e9..f5c76cca5 100644 --- a/src/ortho/debug/ortho_debug-disp.adb +++ b/src/ortho/debug/ortho_debug-disp.adb @@ -480,6 +480,12 @@ package body Ortho_Debug.Disp is Put ("'["); Put_Keyword ("null"); Put (']'); + when OC_Default_Lit => + -- Always disp the type of default literals. + Disp_Tnode_Name (C.Ctype); + Put ("'["); + Put_Keyword ("default"); + Put (']'); when OC_Enum_Lit => -- Always disp the type of enum literals. Disp_Lit (C.Ctype, False, Get_String (C.E_Name)); diff --git a/src/ortho/debug/ortho_debug.adb b/src/ortho/debug/ortho_debug.adb index 218fd9671..6e9b2b89d 100644 --- a/src/ortho/debug/ortho_debug.adb +++ b/src/ortho/debug/ortho_debug.adb @@ -399,11 +399,20 @@ package body Ortho_Debug is if Ltype.Kind /= ON_Access_Type then raise Type_Error; end if; - return new O_Cnode_Null_Lit_Type'(Kind => OC_Null_Lit, + return new O_Cnode_Null_Lit_Type'(Kind => OC_Null_Lit, Ctype => Ltype, Ref => False); end New_Null_Access; + function New_Default_Value (Ltype : O_Tnode) return O_Cnode + is + subtype O_Cnode_Default_Lit_Type is O_Cnode_Type (OC_Default_Lit); + begin + return new O_Cnode_Default_Lit_Type'(Kind => OC_Default_Lit, + Ctype => Ltype, + Ref => False); + end New_Default_Value; + function New_Sizeof (Atype : O_Tnode; Rtype : O_Tnode) return O_Cnode is subtype O_Cnode_Sizeof_Type is O_Cnode_Type (OC_Sizeof_Lit); diff --git a/src/ortho/debug/ortho_debug.private.ads b/src/ortho/debug/ortho_debug.private.ads index 7a050321a..a1e711b62 100644 --- a/src/ortho/debug/ortho_debug.private.ads +++ b/src/ortho/debug/ortho_debug.private.ads @@ -134,6 +134,7 @@ private OC_Sizeof_Lit, OC_Alignof_Lit, OC_Offsetof_Lit, + OC_Default_Lit, OC_Aggregate, OC_Aggr_Element, OC_Union_Aggr, @@ -162,6 +163,8 @@ private E_Name : O_Ident; when OC_Null_Lit => null; + when OC_Default_Lit => + null; when OC_Sizeof_Lit | OC_Alignof_Lit => S_Type : O_Tnode; |