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] |
This patch modifies how library-level finalizers are named and exported to the binder. The names are no longer external identifiers but manually qualified symbols. The following subprogram should compile quietly and produce the expected output. -- main.adb with Pkg; procedure Main is begin null; end Main; -- pkg.ads with Ctrl; use Ctrl; package Pkg is pragma External_Name_Casing (Uppercase, Uppercase); Obj : T; end Pkg; -- ctrl.ads with Ada.Finalization; use Ada.Finalization; package Ctrl is type T is private; private type T is new Controlled with null record; procedure Finalize (Obj : in out T); end Ctrl; -- ctrl.adb with Ada.Text_IO; use Ada.Text_IO; package body Ctrl is procedure Finalize (Obj : in out T) is begin Put_Line ("finalize"); end; end Ctrl; -- Compilation gnatmake -q main.adb -- Expected output finalize Tested on x86_64-pc-linux-gnu, committed on trunk 2011-08-04 Hristian Kirtchev <kirtchev@adacore.com> * bindgen.adb (Gen_Finalize_Library_Ada): Update the import string for library-level finalizers. (Gen_Finalize_Library_C): Update the import string for library-level finalizers. (Gen_Finalize_Library_Defs_C): Update the definition name of a library-level finalizer. * exp_ch7.adb: Remove with and use clauses for Stringt. (Create_Finalizer): Remove local variables Conv_Name, Prag_Decl, Spec_Decl. Add local variable Body_Id. The names of library-level finalizers are now manually fully qualified and are no longer external. A single name is now capable of servicing .NET, JVM and non-VM targets. Pragma Export is no longer required to provide visibility for the name. (Create_Finalizer_String): Removed. (New_Finalizer_Name): New routine which mimics New_..._Name.
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] |