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] References to formals of access_to_subprogram types


This patch adds cross-reference information to the formals of an Access_To_
Subprogram type. Previously these formals were classified as objects; now
they are references as (in, out, in-out) parameters.

Here is an example of the new output of the cross-reference utility;

      gcc -c params_pkg.adb
      gnatxref params_pkg.ali
-----
Param_1                                          parameter integer object
  Decl:  params_pkg.ads         3:23
Param_1                                          parameter integer object
  Decl:  params_pkg.ads         6:19
  Body:  params_pkg.adb         2:19
Param_2                                          parameter float object
  Decl:  params_pkg.ads         4:23
Param_2                                          parameter float object
  Decl:  params_pkg.ads         7:19
  Body:  params_pkg.adb         3:19
Params_Pkg                                       package
  Decl:  params_pkg.ads         1:9
  Body:  params_pkg.adb         1:14
Proc                                             procedure
  Decl:  params_pkg.ads         6:13
  Body:  params_pkg.adb         2:13
Proc_Access_Type                                 access type
  Decl:  params_pkg.ads         2:8

---
package Params_Pkg is
  type Proc_Access_Type is
    access procedure (Param_1 : in Integer;
                      Param_2 : out Float);

  procedure Proc (Param_1 : in Integer;
                  Param_2 : out Float);
end Params_Pkg;
---
package body Params_Pkg is
  procedure Proc (Param_1 : in Integer;
                  Param_2 : out Float) is
  begin
     null;
  end;

end Params_Pkg;

Tested on x86_64-pc-linux-gnu, committed on trunk

2013-07-05  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Access_Subprogram_Declaration): Use
	Generate_Reference_To_Formals.
	* lib-xref.adb (Generate_Reference_To_Formals): In the case of
	access to subprograms, the formals are found in the designated
	subprogram type.

Attachment: difs
Description: Text document


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