diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-11-16 04:43:41 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-11-16 05:11:39 +0100 |
commit | 7414046cc73ecc16bfa2ce3af3cb529195ce120f (patch) | |
tree | 97adafa9b32725c2e92b280f005ff31da38655d6 /src/ortho/mcode/ortho_code-consts.adb | |
parent | 9a8b35ac990386252bfb4e65f76acaa739d7967c (diff) | |
download | ghdl-7414046cc73ecc16bfa2ce3af3cb529195ce120f.tar.gz ghdl-7414046cc73ecc16bfa2ce3af3cb529195ce120f.tar.bz2 ghdl-7414046cc73ecc16bfa2ce3af3cb529195ce120f.zip |
mcode: add new_default_value.
Diffstat (limited to 'src/ortho/mcode/ortho_code-consts.adb')
-rw-r--r-- | src/ortho/mcode/ortho_code-consts.adb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ortho/mcode/ortho_code-consts.adb b/src/ortho/mcode/ortho_code-consts.adb index 4522e674a..7cc554211 100644 --- a/src/ortho/mcode/ortho_code-consts.adb +++ b/src/ortho/mcode/ortho_code-consts.adb @@ -219,6 +219,13 @@ package body Ortho_Code.Consts is return Cnodes.Last; end New_Null_Access; + function New_Default_Value (Ltype : O_Tnode) return O_Cnode is + begin + Cnodes.Append (Cnode_Common'(Kind => OC_Zero, + Lit_Type => Ltype)); + return Cnodes.Last; + end New_Default_Value; + function To_Cnode_Common is new Ada.Unchecked_Conversion (Source => Cnode_Addr, Target => Cnode_Common); @@ -525,7 +532,8 @@ package body Ortho_Code.Consts is | OC_Sizeof | OC_Alignof | OC_Address - | OC_Subprg_Address => + | OC_Subprg_Address + | OC_Zero => raise Syntax_Error; end case; end Get_Const_Bytes; |