Comments
Patch
===================================================================
@@ -3655,10 +3655,21 @@
Comp_Unit := Get_Source_Unit (E);
Set_Convention_From_Pragma (E);
- -- Treat a pragma Import as an implicit body, for GPS use
+ -- Treat a pragma Import as an implicit body, and pragma import
+ -- as implicit reference (for navigation in GPS).
if Prag_Id = Pragma_Import then
Generate_Reference (E, Id, 'b');
+
+ -- For exported entities we restrict the generation of references
+ -- to entities exported to foreign languages since entities
+ -- exported to Ada do not provide further information to GPS and
+ -- add undesired references to the output of the gnatxref tool.
+
+ elsif Prag_Id = Pragma_Export
+ and then Convention (E) /= Convention_Ada
+ then
+ Generate_Reference (E, Id, 'i');
end if;
-- Loop through the homonyms of the pragma argument's entity
===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 1998-2012, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -1105,9 +1105,10 @@
-- Imported entities might special indication as to their external
-- name:
- -- 5U14*Foo2 5>20 6b<c,myfoo2>22
+ -- 5U14*Foo2 5>20 6b<c,myfoo2>22 # Imported entity
+ -- 5U14*Foo2 5>20 6i<c,myfoo2>22 # Exported entity
- if R_Type = 'b'
+ if (R_Type = 'b' or else R_Type = 'i')
and then Ali (Ptr) = '<'
then
while Ptr <= Ali'Last
===================================================================
@@ -2441,11 +2441,13 @@
(Int (Get_Logical_Line_Number (XE.Key.Loc)));
Write_Info_Char (XE.Key.Typ);
- if Is_Overloadable (XE.Key.Ent)
- and then Is_Imported (XE.Key.Ent)
- and then XE.Key.Typ = 'b'
- then
- Output_Import_Export_Info (XE.Key.Ent);
+ if Is_Overloadable (XE.Key.Ent) then
+ if (Is_Imported (XE.Key.Ent) and then XE.Key.Typ = 'b')
+ or else
+ (Is_Exported (XE.Key.Ent) and then XE.Key.Typ = 'i')
+ then
+ Output_Import_Export_Info (XE.Key.Ent);
+ end if;
end if;
Write_Info_Nat (Int (Get_Column_Number (XE.Key.Loc)));