Commit 5d59eef2 by Arnaud Charlet

[multiple changes]

2011-08-29  Tristan Gingold  <gingold@adacore.com>

	* a-exexpr.adb, a-except-2005.ads (Jmpbuf_Address): Move to a-exexpr.adb
	(To_Jmpbuf_Address): Ditto
	(builtin_longjmp): Ditto

2011-08-29  Thomas Quinot  <quinot@adacore.com>

	* sem_res.adb: Minor reformatting.

2011-08-29  Vincent Celier  <celier@adacore.com>

	* make.adb (Gnatmake): Move special processing for VM targets after the
	call to Get_Target_Parameters.

2011-08-29  Thomas Quinot  <quinot@adacore.com>

	* sem_ch12.adb, par-ch12.adb: Minor reformatting.

From-SVN: r178197
parent 949a18cc
2011-08-29 Tristan Gingold <gingold@adacore.com>
* a-exexpr.adb, a-except-2005.ads (Jmpbuf_Address): Move to a-exexpr.adb
(To_Jmpbuf_Address): Ditto
(builtin_longjmp): Ditto
2011-08-29 Thomas Quinot <quinot@adacore.com>
* sem_res.adb: Minor reformatting.
2011-08-29 Vincent Celier <celier@adacore.com>
* make.adb (Gnatmake): Move special processing for VM targets after the
call to Get_Target_Parameters.
2011-08-29 Thomas Quinot <quinot@adacore.com>
* sem_ch12.adb, par-ch12.adb: Minor reformatting.
2011-08-29 Hristian Kirtchev <kirtchev@adacore.com> 2011-08-29 Hristian Kirtchev <kirtchev@adacore.com>
* sem_res.adb (Resolve_Allocator): Implement Ada2012-B052. Detect cases * sem_res.adb (Resolve_Allocator): Implement Ada2012-B052. Detect cases
......
...@@ -50,8 +50,6 @@ with System.Parameters; ...@@ -50,8 +50,6 @@ with System.Parameters;
with System.Standard_Library; with System.Standard_Library;
with System.Traceback_Entries; with System.Traceback_Entries;
with Ada.Unchecked_Conversion;
package Ada.Exceptions is package Ada.Exceptions is
pragma Warnings (Off); pragma Warnings (Off);
pragma Preelaborate_05; pragma Preelaborate_05;
...@@ -230,16 +228,13 @@ private ...@@ -230,16 +228,13 @@ private
-- system to return here rather than to the original location. -- system to return here rather than to the original location.
procedure Raise_From_Controlled_Operation procedure Raise_From_Controlled_Operation
(X : Ada.Exceptions.Exception_Occurrence; (X : Ada.Exceptions.Exception_Occurrence);
From_Abort : Boolean);
pragma No_Return (Raise_From_Controlled_Operation); pragma No_Return (Raise_From_Controlled_Operation);
pragma Export pragma Export
(Ada, Raise_From_Controlled_Operation, (Ada, Raise_From_Controlled_Operation,
"__gnat_raise_from_controlled_operation"); "__gnat_raise_from_controlled_operation");
-- Raise Program_Error, providing information about X (an exception raised -- Raise Program_Error, providing information about X (an exception raised
-- during a controlled operation) in the exception message. However, if the -- during a controlled operation) in the exception message.
-- finalization was triggered by abort, keep aborting instead of raising
-- Program_Error.
procedure Reraise_Occurrence_Always (X : Exception_Occurrence); procedure Reraise_Occurrence_Always (X : Exception_Occurrence);
pragma No_Return (Reraise_Occurrence_Always); pragma No_Return (Reraise_Occurrence_Always);
...@@ -359,18 +354,4 @@ private ...@@ -359,18 +354,4 @@ private
Tracebacks => (others => TBE.Null_TB_Entry), Tracebacks => (others => TBE.Null_TB_Entry),
Private_Data => System.Null_Address); Private_Data => System.Null_Address);
-- Common binding to __builtin_longjmp for sjlj variants.
-- The builtin expects a pointer type for the jmpbuf address argument, and
-- System.Address doesn't work because this is really an integer type.
type Jmpbuf_Address is access Character;
function To_Jmpbuf_Address is new
Ada.Unchecked_Conversion (System.Address, Jmpbuf_Address);
procedure builtin_longjmp (buffer : Jmpbuf_Address; Flag : Integer);
pragma No_Return (builtin_longjmp);
pragma Import (Intrinsic, builtin_longjmp, "__builtin_longjmp");
end Ada.Exceptions; end Ada.Exceptions;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
with System.Storage_Elements; use System.Storage_Elements; with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Conversion;
pragma Warnings (Off); pragma Warnings (Off);
-- Since several constructs give warnings in 3.14a1, including unreferenced -- Since several constructs give warnings in 3.14a1, including unreferenced
-- variables and pragma Unreferenced itself. -- variables and pragma Unreferenced itself.
...@@ -41,6 +43,20 @@ pragma Warnings (Off); ...@@ -41,6 +43,20 @@ pragma Warnings (Off);
separate (Ada.Exceptions) separate (Ada.Exceptions)
package body Exception_Propagation is package body Exception_Propagation is
-- Common binding to __builtin_longjmp for sjlj variants.
-- The builtin expects a pointer type for the jmpbuf address argument, and
-- System.Address doesn't work because this is really an integer type.
type Jmpbuf_Address is access Character;
function To_Jmpbuf_Address is new
Ada.Unchecked_Conversion (System.Address, Jmpbuf_Address);
procedure builtin_longjmp (buffer : Jmpbuf_Address; Flag : Integer);
pragma No_Return (builtin_longjmp);
pragma Import (Intrinsic, builtin_longjmp, "__builtin_longjmp");
--------------------- ---------------------
-- Setup_Exception -- -- Setup_Exception --
--------------------- ---------------------
......
...@@ -5931,29 +5931,6 @@ package body Make is ...@@ -5931,29 +5931,6 @@ package body Make is
("nothing to do for a main project that is externally built"); ("nothing to do for a main project that is externally built");
end if; end if;
-- Special processing for VM targets
if Targparm.VM_Target /= No_VM then
-- Set proper processing commands
case Targparm.VM_Target is
when Targparm.JVM_Target =>
-- Do not check for an object file (".o") when compiling to
-- JVM machine since ".class" files are generated instead.
Check_Object_Consistency := False;
Gcc := new String'("jvm-gnatcompile");
when Targparm.CLI_Target =>
Gcc := new String'("dotnet-gnatcompile");
when Targparm.No_VM =>
raise Program_Error;
end case;
end if;
-- If no project file is used, we just put the gcc switches -- If no project file is used, we just put the gcc switches
-- from the command line in the Gcc_Switches table. -- from the command line in the Gcc_Switches table.
...@@ -6125,6 +6102,29 @@ package body Make is ...@@ -6125,6 +6102,29 @@ package body Make is
Make_Failed ("*** make failed."); Make_Failed ("*** make failed.");
end; end;
-- Special processing for VM targets
if Targparm.VM_Target /= No_VM then
-- Set proper processing commands
case Targparm.VM_Target is
when Targparm.JVM_Target =>
-- Do not check for an object file (".o") when compiling to
-- JVM machine since ".class" files are generated instead.
Check_Object_Consistency := False;
Gcc := new String'("jvm-gnatcompile");
when Targparm.CLI_Target =>
Gcc := new String'("dotnet-gnatcompile");
when Targparm.No_VM =>
raise Program_Error;
end case;
end if;
Is_First_Main := False; Is_First_Main := False;
end if; end if;
......
...@@ -533,7 +533,7 @@ package body Ch12 is ...@@ -533,7 +533,7 @@ package body Ch12 is
if Token = Tok_Semicolon then if Token = Tok_Semicolon then
-- Ada2012: Incomplete formal type -- Ada 2012: Incomplete formal type
Scan; -- past semicolon Scan; -- past semicolon
......
...@@ -342,8 +342,8 @@ package body Sem_Ch12 is ...@@ -342,8 +342,8 @@ package body Sem_Ch12 is
Def : Node_Id); Def : Node_Id);
-- Creates a new private type, which does not require completion -- Creates a new private type, which does not require completion
procedure Analyze_Formal_Incomplete_Type (T : Entity_Id; Def : Node_Id); procedure Analyze_Formal_Incomplete_Type (T : Entity_Id; Def : Node_Id);
-- Ada2012: Creates a new incomplete type whose actual does not freeze -- Ada 2012: Creates a new incomplete type whose actual does not freeze
procedure Analyze_Generic_Formal_Part (N : Node_Id); procedure Analyze_Generic_Formal_Part (N : Node_Id);
-- Analyze generic formal part -- Analyze generic formal part
...@@ -1304,8 +1304,8 @@ package body Sem_Ch12 is ...@@ -1304,8 +1304,8 @@ package body Sem_Ch12 is
Assoc); Assoc);
-- An instantiation is a freeze point for the actuals, -- An instantiation is a freeze point for the actuals,
-- unless this is a rewritten formal package, and -- unless this is a rewritten formal package, or the
-- unless it is an Ada2012 formal incomplete type. -- formal is an Ada 2012 formal incomplete type.
if Nkind (I_Node) /= N_Formal_Package_Declaration if Nkind (I_Node) /= N_Formal_Package_Declaration
and then and then
...@@ -1316,9 +1316,8 @@ package body Sem_Ch12 is ...@@ -1316,9 +1316,8 @@ package body Sem_Ch12 is
end if; end if;
end if; end if;
-- A remote access-to-class-wide type must not be an -- A remote access-to-class-wide type is not a legal actual
-- actual parameter for a generic formal of an access -- for a generic formal of an access type (E.2.2(17)).
-- type (E.2.2 (17)).
if Nkind (Analyzed_Formal) = N_Formal_Type_Declaration if Nkind (Analyzed_Formal) = N_Formal_Type_Declaration
and then and then
...@@ -9483,9 +9482,9 @@ package body Sem_Ch12 is ...@@ -9483,9 +9482,9 @@ package body Sem_Ch12 is
procedure Validate_Interface_Type_Instance; procedure Validate_Interface_Type_Instance;
procedure Validate_Private_Type_Instance; procedure Validate_Private_Type_Instance;
procedure Validate_Incomplete_Type_Instance; procedure Validate_Incomplete_Type_Instance;
-- These procedures perform validation tests for the named case -- These procedures perform validation tests for the named case.
-- Validate_Discriminated_Formal_Type is shared by formal private -- Validate_Discriminated_Formal_Type is shared by formal private
-- types and Ada2012 formal incomplete types. -- types and Ada 2012 formal incomplete types.
function Subtypes_Match (Gen_T, Act_T : Entity_Id) return Boolean; function Subtypes_Match (Gen_T, Act_T : Entity_Id) return Boolean;
-- Check that base types are the same and that the subtypes match -- Check that base types are the same and that the subtypes match
......
...@@ -4388,9 +4388,9 @@ package body Sem_Res is ...@@ -4388,9 +4388,9 @@ package body Sem_Res is
Discr : constant Entity_Id := Discr : constant Entity_Id :=
Defining_Identifier (Associated_Node_For_Itype (Typ)); Defining_Identifier (Associated_Node_For_Itype (Typ));
begin begin
-- Ada2012-B052: If the designated type of the allocator is -- Ada 2012 AI05-0052: If the designated type of the allocator
-- limited, then the allocator shall not be used to define the -- is limited, then the allocator shall not be used to define
-- value of an access discriminant, unless the discriminated -- the value of an access discriminant unless the discriminated
-- type is immutably limited. -- type is immutably limited.
if Ada_Version >= Ada_2012 if Ada_Version >= Ada_2012
...@@ -4398,9 +4398,8 @@ package body Sem_Res is ...@@ -4398,9 +4398,8 @@ package body Sem_Res is
and then not Is_Immutably_Limited_Type (Scope (Discr)) and then not Is_Immutably_Limited_Type (Scope (Discr))
then then
Error_Msg_N Error_Msg_N
("only immutably limited types can have anonymous ", N); ("only immutably limited types can have anonymous "
Error_Msg_N & "access discriminants designating a limited type", N);
("\discriminants of limited designated type", N);
end if; end if;
end; end;
......
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