Commit cfae2bed by Arnaud Charlet

[multiple changes]

2011-08-04  Robert Dewar  <dewar@adacore.com>

	* sem_util.adb: Minor reformatting.

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.

From-SVN: r177322
parent 01f0729a
2011-08-04 Robert Dewar <dewar@adacore.com>
* sem_util.adb: Minor reformatting.
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.
2011-08-04 Eric Botcazou <ebotcazou@adacore.com>
* sem_elab.adb (Check_Internal_Call_Continue): Change the type of the
......
......@@ -1688,13 +1688,16 @@ package body Bindgen is
Write_Statement_Buffer;
-- Generate:
-- pragma Import (CIL, F<Count>, "xx.yy_pkg.Finalize[B/S]");
-- pragma Import (CIL, F<Count>,
-- "xx.yy_pkg.xx__yy__finalize_[body|spec]");
-- -- for .NET targets
-- pragma Import (Java, F<Count>, "xx$yy.Finalize[B/S]");
-- pragma Import (Java, F<Count>,
-- "xx$yy.xx__yy__finalize_[body|spec]");
-- -- for JVM targets
-- pragma Import (Ada, F<Count>, "xx__yy__Finalize[B/S]");
-- pragma Import (Ada, F<Count>,
-- "xx__yy__finalize_[body|spec]");
-- -- for default targets
if VM_Target = CLI_Target then
......@@ -1723,36 +1726,35 @@ package body Bindgen is
-- Perform name construction
-- .NET xx.yy_pkg.finalize
-- .NET xx.yy_pkg.xx__yy__finalize
if VM_Target = CLI_Target then
Set_Unit_Name (Mode => Dot);
Set_String ("_pkg.finalize");
Set_String ("_pkg.");
-- JVM xx$yy.finalize
-- JVM xx$yy.xx__yy__finalize
elsif VM_Target = JVM_Target then
Set_Unit_Name (Mode => Dollar_Sign);
Set_String (".finalize");
Set_Char ('.');
end if;
-- Default xx__yy__finalize
else
Set_Unit_Name;
Set_String ("__finalize");
end if;
Set_Unit_Name;
Set_String ("__finalize_");
-- Package spec processing
if U.Utype = Is_Spec
or else U.Utype = Is_Spec_Only
then
Set_Char ('S');
Set_String ("spec");
-- Package body processing
else
Set_Char ('B');
Set_String ("body");
end if;
Set_String (""");");
......@@ -1895,12 +1897,12 @@ package body Bindgen is
-- uname_E--;
-- if (uname_E == 0)
-- uname__finalize[S|B] ();
-- uname__finalize_[spec|body] ();
-- Otherwise, finalization routines are called unconditionally:
-- uname_E--;
-- uname__finalize[S|B] ();
-- uname__finalize_[spec|body] ();
Set_String (" ");
Set_Unit_Name;
......@@ -1918,19 +1920,19 @@ package body Bindgen is
Set_String (" ");
Get_Name_String (Uspec.Uname);
Set_Unit_Name;
Set_String ("__finalize");
Set_String ("__finalize_");
-- Package spec processing
if U.Utype = Is_Spec
or else U.Utype = Is_Spec_Only
then
Set_Char ('S');
Set_String ("spec");
-- Package body processing
else
Set_Char ('B');
Set_String ("body");
end if;
Set_String (" ();");
......@@ -1982,14 +1984,14 @@ package body Bindgen is
Set_String ("extern void ");
Get_Name_String (Uspec.Uname);
Set_Unit_Name;
Set_String ("__finalize");
Set_String ("__finalize_");
if U.Utype = Is_Spec
or else U.Utype = Is_Spec_Only
then
Set_Char ('S');
Set_String ("spec");
else
Set_Char ('B');
Set_String ("body");
end if;
Set_String (" (void);");
......
......@@ -964,8 +964,7 @@ package body Sem_Util is
Defining_Identifier => Elab_Ent,
Object_Definition =>
New_Occurrence_Of (Standard_Short_Integer, Loc),
Expression =>
Make_Integer_Literal (Loc, Uint_0));
Expression => Make_Integer_Literal (Loc, Uint_0));
Push_Scope (Standard_Standard);
Add_Global_Declaration (Decl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment