aboutsummaryrefslogtreecommitdiffstats
path: root/translate
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-03-09 07:05:34 +0100
committerTristan Gingold <tgingold@free.fr>2014-03-09 07:05:34 +0100
commit6a8dd0ee9bd3ec2ffe6ff7fa821af92968008e55 (patch)
tree4dacb60b5a1e11f29a7fd1c279471ac2be6a0698 /translate
parentf1cbfa0165ced1fc75f8fea817b0e8e3bcfe6b47 (diff)
downloadghdl-6a8dd0ee9bd3ec2ffe6ff7fa821af92968008e55.tar.gz
ghdl-6a8dd0ee9bd3ec2ffe6ff7fa821af92968008e55.tar.bz2
ghdl-6a8dd0ee9bd3ec2ffe6ff7fa821af92968008e55.zip
Automatically unnest subprograms for llvm.
Diffstat (limited to 'translate')
-rw-r--r--translate/translation.adb10
-rw-r--r--translate/translation.ads2
2 files changed, 10 insertions, 2 deletions
diff --git a/translate/translation.adb b/translate/translation.adb
index 908d8199d..0d9e8bf32 100644
--- a/translate/translation.adb
+++ b/translate/translation.adb
@@ -28201,12 +28201,18 @@ package body Translation is
Interfaces : O_Inter_List;
Param : O_Dnode;
begin
+ -- Create the node extension for translate.
Node_Infos.Init;
Node_Infos.Set_Last (4);
Node_Infos.Table (0 .. 4) := (others => null);
+
+ -- Force to unnest subprograms is the code generator doesn't support
+ -- nested subprograms.
+ if not Ortho_Nodes.Has_Nested_Subprograms then
+ Flag_Unnest_Subprograms := True;
+ end if;
+
New_Debug_Comment_Decl ("internal declarations, part 1");
- -- Give a name to sizetype.
- --Finish_Type_Decl (Sizetype, Get_Identifier ("__ghdl_size_t"));
-- Create well known identifiers.
Wki_This := Get_Identifier ("this");
diff --git a/translate/translation.ads b/translate/translation.ads
index bcaec623a..e779685f2 100644
--- a/translate/translation.ads
+++ b/translate/translation.ads
@@ -77,6 +77,8 @@ package Translation is
Flag_Discard_Identifiers : Boolean := False;
-- If true, do not create nested subprograms.
+ -- This flag is forced during initialization if the code generated doesn't
+ -- support nested subprograms.
Flag_Unnest_Subprograms : Boolean := False;
type Foreign_Kind_Type is (Foreign_Unknown,