diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-11-23 04:28:44 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-11-23 04:29:21 +0100 |
commit | f2c4cfadb13dd5eef1979069317e5c6ee224c908 (patch) | |
tree | 501db6bae01657d120a033f3ff2414b011e9135e /src/vhdl/translate/translation.adb | |
parent | 3d81a74f66c2440ebde7efc64415d6c5510e94ee (diff) | |
download | ghdl-f2c4cfadb13dd5eef1979069317e5c6ee224c908.tar.gz ghdl-f2c4cfadb13dd5eef1979069317e5c6ee224c908.tar.bz2 ghdl-f2c4cfadb13dd5eef1979069317e5c6ee224c908.zip |
Add --max-stack-alloc option, check stack allocation of complex object.
Fix #692
Diffstat (limited to 'src/vhdl/translate/translation.adb')
-rw-r--r-- | src/vhdl/translate/translation.adb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vhdl/translate/translation.adb b/src/vhdl/translate/translation.adb index 2edeba0be..0999e792e 100644 --- a/src/vhdl/translate/translation.adb +++ b/src/vhdl/translate/translation.adb @@ -15,6 +15,7 @@ -- along with GCC; see the file COPYING. If not, write to the Free -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. +with Interfaces; use Interfaces; with Ortho_Nodes; use Ortho_Nodes; with Ortho_Ident; use Ortho_Ident; with Flags; use Flags; @@ -1079,6 +1080,20 @@ package body Translation is Create_Report_Subprg ("__ghdl_report", Ghdl_Report); end; + -- procedure __ghdl_check_stack_allocation (size : __ghdl_index_type) + Start_Procedure_Decl + (Interfaces, Get_Identifier ("__ghdl_check_stack_allocation"), + O_Storage_External); + New_Interface_Decl (Interfaces, Param, Wki_Val, Ghdl_Index_Type); + Finish_Subprogram_Decl (Interfaces, Ghdl_Check_Stack_Allocation); + + if Flag_Check_Stack_Allocation > 0 then + Check_Stack_Allocation_Threshold := + New_Index_Lit (Unsigned_64 (Flag_Check_Stack_Allocation)); + else + Check_Stack_Allocation_Threshold := O_Cnode_Null; + end if; + -- procedure __ghdl_text_write (file : __ghdl_file_index; -- str : std_string_ptr); Start_Procedure_Decl |