diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-03-08 07:04:05 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-03-08 07:04:05 +0100 |
commit | e6001445a14d5e96db78ff56c68d8ae96dec0968 (patch) | |
tree | 77394e40d752c04e5f4ce61b0c868aa2d4b06fa3 /ortho/debug | |
parent | d9bb785009b005cc314f063ae05b8974fd8f4bf2 (diff) | |
download | ghdl-e6001445a14d5e96db78ff56c68d8ae96dec0968.tar.gz ghdl-e6001445a14d5e96db78ff56c68d8ae96dec0968.tar.bz2 ghdl-e6001445a14d5e96db78ff56c68d8ae96dec0968.zip |
Share spec of ortho_nodes, adjust code.
Diffstat (limited to 'ortho/debug')
-rw-r--r-- | ortho/debug/Makefile | 7 | ||||
-rw-r--r-- | ortho/debug/ortho_debug.adb | 11 | ||||
-rw-r--r-- | ortho/debug/ortho_debug.private.ads | 39 |
3 files changed, 29 insertions, 28 deletions
diff --git a/ortho/debug/Makefile b/ortho/debug/Makefile index 7ebaf9d94..0c15111ef 100644 --- a/ortho/debug/Makefile +++ b/ortho/debug/Makefile @@ -31,17 +31,16 @@ SED=sed all: $(ortho_exec) -$(ortho_exec): force $(orthobe_srcdir)/ortho_debug.ads +$(ortho_exec): force $(ortho_srcdir)/$(BE)/ortho_debug.ads gnatmake -o $@ $(GNATMAKE_FLAGS) ortho_debug-main -bargs -E $(LARGS) clean: $(RM) -f *.o *.ali *~ b~*.ad? ortho_nodes-main - $(RM) $(orthobe_srcdir)/ortho_debug.ads + $(RM) ortho_debug.ads force: -ORTHO_PACKAGE=Ortho_Debug -ORTHO_BASENAME=$(orthobe_srcdir)/ortho_debug +ORTHO_BASENAME=ortho_debug # Automatically build ortho_debug.ads from ortho_node.common.ads and # ortho_debug.private.ads diff --git a/ortho/debug/ortho_debug.adb b/ortho/debug/ortho_debug.adb index a1ef7b82a..8285a6473 100644 --- a/ortho/debug/ortho_debug.adb +++ b/ortho/debug/ortho_debug.adb @@ -39,8 +39,6 @@ package body Ortho_Debug is ON_And => OE_And, ON_Or => OE_Or, ON_Xor => OE_Xor, - ON_And_Then => OE_And_Then, - ON_Or_Else => OE_Or_Else, -- Monadic operations. ON_Not => OE_Not, @@ -439,7 +437,7 @@ package body Ortho_Debug is S_Type => Atype); end New_Alignof; - function New_Offsetof (Rec_Type : O_Tnode; Field : O_Fnode; Rtype : O_Tnode) + function New_Offsetof (Atype : O_Tnode; Field : O_Fnode; Rtype : O_Tnode) return O_Cnode is subtype O_Cnode_Offsetof_Type is O_Cnode_Type (OC_Offsetof_Lit); @@ -449,7 +447,7 @@ package body Ortho_Debug is then raise Type_Error; end if; - if Field.Parent /= Rec_Type then + if Field.Parent /= Atype then raise Type_Error; end if; return new O_Cnode_Offsetof_Type'(Kind => OC_Offsetof_Lit, @@ -1269,9 +1267,6 @@ package body Ortho_Debug is Add_Decl (Res); end New_Const_Decl; - -- Const is not modified - pragma Warnings (Off, "*is not modified"); - procedure Start_Const_Value (Const : in out O_Dnode) is subtype O_Dnode_Const_Value is O_Dnode_Type (ON_Const_Value); @@ -1321,8 +1316,6 @@ package body Ortho_Debug is Const.Const_Value.Value := Val; end Finish_Const_Value; - pragma Warnings (On, "*is not modified"); - procedure New_Var_Decl (Res : out O_Dnode; Ident : O_Ident; diff --git a/ortho/debug/ortho_debug.private.ads b/ortho/debug/ortho_debug.private.ads index 09d9b4c6f..98424efdf 100644 --- a/ortho/debug/ortho_debug.private.ads +++ b/ortho/debug/ortho_debug.private.ads @@ -1,5 +1,5 @@ -- Ortho debug back-end declarations. --- Copyright (C) 2005 Tristan Gingold +-- Copyright (C) 2005-2014 Tristan Gingold -- -- GHDL is free software; you can redistribute it and/or modify it under -- the terms of the GNU General Public License as published by the Free @@ -16,27 +16,26 @@ -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. +with Interfaces; use Interfaces; +with Ortho_Ident; +use Ortho_Ident; + +-- Interface to create nodes. package Ortho_Debug is - type O_Enode is private; - type O_Cnode is private; - type O_Lnode is private; + procedure Init; + procedure Finish; + +private -- A node for a type. - type O_Tnode_Type (<>) is private; + type O_Tnode_Type (<>); type O_Tnode is access O_Tnode_Type; + -- A node for a statement. - type O_Snode_Type (<>) is private; + type O_Snode_Type (<>); type O_Snode is access O_Snode_Type; - -- A node for a function. - type O_Dnode_Type (<>) is private; - type O_Dnode is access O_Dnode_Type; - -- A node for a record element. - type O_Fnode_Type is private; - type O_Fnode is access O_Fnode_Type; - procedure Init; - procedure Finish; Top : O_Snode; -private + type Str_Acc is access String; type Decl_Scope_Type; @@ -48,7 +47,12 @@ private ON_Function_Decl, ON_Function_Body, ON_Const_Value, ON_Debug_Line_Decl, ON_Debug_Comment_Decl, ON_Debug_Filename_Decl); + + type O_Dnode_Type (<>); + type O_Dnode is access O_Dnode_Type; + O_Dnode_Null : constant O_Dnode := null; + type O_Dnode_Type (Kind : On_Decl_Kind) is record Next : O_Dnode; Name : O_Ident; @@ -88,7 +92,12 @@ private end case; end record; + -- A node for a record element. + type O_Fnode_Type; + type O_Fnode is access O_Fnode_Type; + O_Fnode_Null : constant O_Fnode := null; + type O_Fnode_Type is record -- Record type. Parent : O_Tnode; |