diff options
Diffstat (limited to 'translate/translation.ads')
-rw-r--r-- | translate/translation.ads | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/translate/translation.ads b/translate/translation.ads index 2b885a8da..55af06967 100644 --- a/translate/translation.ads +++ b/translate/translation.ads @@ -17,8 +17,6 @@ -- 02111-1307, USA. with Iirs; use Iirs; with Ortho_Nodes; -with Ortho_Ident; use Ortho_Ident; -with Types; use Types; package Translation is -- Initialize the package: create internal nodes. @@ -69,20 +67,21 @@ package Translation is type Foreign_Info_Type (Kind : Foreign_Kind_Type := Foreign_Unknown) is record - Subprg : O_Ident; - case Kind is when Foreign_Unknown => null; when Foreign_Vhpidirect => - Lib : Name_Id; + -- Positions in name_table.name_buffer. + Lib_First : Natural; + Lib_Last : Natural; + Subprg_First : Natural; + Subprg_Last : Natural; when Foreign_Intrinsic => null; end case; end record; - Foreign_Bad : constant Foreign_Info_Type := (Kind => Foreign_Unknown, - Subprg => O_Ident_Nul); + Foreign_Bad : constant Foreign_Info_Type := (Kind => Foreign_Unknown); -- Return a foreign_info for DECL. -- Can generate error messages, if the attribute expression is ill-formed. @@ -90,7 +89,12 @@ package Translation is -- Otherwise, only KIND discriminent is set. -- EXTRACT_NAME should be set only inside translation itself, since the -- name can be based on the prefix. - function Translate_Foreign_Id (Decl : Iir; Extract_Name : Boolean) - return Foreign_Info_Type; - + function Translate_Foreign_Id (Decl : Iir) return Foreign_Info_Type; + + -- If not null, this procedure is called when a foreign subprogram is + -- created. + type Foreign_Hook_Access is access procedure (Decl : Iir; + Info : Foreign_Info_Type; + Ortho : Ortho_Nodes.O_Dnode); + Foreign_Hook : Foreign_Hook_Access := null; end Translation; |