Skip to content

Commit 5fa19e4

Browse files
committed
Add skeleton of gather-symbols passlet
This will find all symbol-expressions and create symbol table entries for them.
1 parent a4a32b4 commit 5fa19e4

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

gnat2goto/driver/driver.adb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@
2424
with Switch; use Switch;
2525
with Tree_Walk; use Tree_Walk;
2626
with Irep_Schemata; use Irep_Schemata;
27+
with Symbol_Table_Info; use Symbol_Table_Info;
28+
with Gather_Irep_Symbols;
29+
with Iinfo; use Iinfo;
2730

2831
package body Driver is
2932

3033
procedure GNAT_To_Goto (GNAT_Root : Node_Id)
3134
is
32-
Unused : constant Irep_Code_Block := Do_Compilation_Unit (GNAT_Root);
35+
Program_Irep : constant Irep_Code_Block := Do_Compilation_Unit (GNAT_Root);
36+
Local_Symbol_Table : Symbol_Table;
3337
begin
34-
null; -- ??? dump to JSON file
38+
Gather_Irep_Symbols.Gather (Local_Symbol_Table, Irep (Program_Irep));
3539
end GNAT_To_Goto;
3640

3741
function Is_Back_End_Switch (Switch : String) return Boolean is
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
package body Gather_Irep_Symbols is
3+
4+
procedure Gather (Table : in out Symbol_Table; Ir : Irep) is
5+
begin
6+
null;
7+
end;
8+
9+
end Gather_Irep_Symbols;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
with Symbol_Table_Info; use Symbol_Table_Info;
2+
with Iinfo; use Iinfo;
3+
4+
package Gather_Irep_Symbols is
5+
6+
procedure Gather (Table : in out Symbol_Table; Ir : Irep);
7+
8+
end Gather_Irep_Symbols;

0 commit comments

Comments
 (0)