This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Enhance gnat.source_info.enclosing_entity


Tested on i686-linux, committed on HEAD

Enhance gnat.source_info.enclosing_entity to use fully qualified name.

The following is an example of the enhanced feature:

 gnatmake -q proc

Output:

call from Proc.P1.Inst
call from Proc.P2.Inst

with Gnat.Source_Info;
with Text_IO; Text_IO text_io;
procedure Proc is
    generic
    procedure Gen (X : Integer);
    procedure Gen (X : Integer) is
    begin
       Put_Line ("call from " & gnat.source_info.enclosing_entity);
    end;
    package P1 is
       procedure Inst is new Gen;
    end P1;
    package P2 is
       procedure Inst is new Gen;
    end P2;
begin
    P1.Inst (1);
    P2.Inst (1);
end;

2005-09-01  Ed Schonberg  <schonberg@adacore.com>

	* exp_intr.adb (Expand_Source_Name): For Enclosing_Entity, generate
	fully qualified name, to distinguish instances with the same local name.

	* g-souinf.ads (Enclosing_Entity): Document that entity name is now
	fully qualified.

Attachment: difs.18
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]