Commit a99ada67 by Robert Dewar Committed by Arnaud Charlet

a-reatim.adb: Documentation addition

2007-04-20  Robert Dewar  <dewar@adacore.com>

	* a-reatim.adb: Documentation addition

	* g-cgideb.adb: Minor code reorganization

	* tree_io.adb, treepr.adb, cstand.adb, krunch.adb, par.adb,
	mdll-utl.adb, par-ch5.adb, par-tchk.adb, s-exctab.ads, s-memory.ads,
	s-osprim.ads, s-restri.ads, s-soflin.ads: Minor reformatting.

	* debug.ads, debug.adb (Get_Debug_Flag_K): Remove unused obsolete
	function.  Change name New_Scope to Push_Scope
	(Get_Debug_Flag_K): Remove unused obsolete function.

	* exp_ch8.adb, inline.adb, sem_ch8.ads: Change name New_Scope to
	Push_Scope.

	* makeusg.adb: Update Copyright notice
	Add line for switch -aP

	* makeusg.adb: Fix wording of some usage messages

	* s-assert.adb (Raise_Assert_Failure): Add call to
	Debug_Raise_Assert_Failure.

	* s-unstyp.ads (type Packed_Bytes2): Change alignment to use 'Min
	(2, Standard'Alignment) for compatibility with AAMP (where alignment
	is restricted to 1).

	* s-wchjis.adb: Remove use of System.Pure_Exceptions

	* tbuild.ads, tbuild.adb (Make_Implicit_Exception_Handler): Set the
	node location to No_Location when we're not debugging the expanded
	code.

From-SVN: r125478
parent 7d2e68b3
...@@ -241,6 +241,11 @@ package body Ada.Real_Time is ...@@ -241,6 +241,11 @@ package body Ada.Real_Time is
function To_Time_Span (D : Duration) return Time_Span is function To_Time_Span (D : Duration) return Time_Span is
begin begin
-- Note regarding AI-00432 requiring range checking on this conversion.
-- In almost all versions of GNAT (and all to which this version of the
-- Ada.Real_Time package apply), the range of Time_Span and Duration are
-- the same, so there is no issue of overflow.
return Time_Span (D); return Time_Span (D);
end To_Time_Span; end To_Time_Span;
......
...@@ -430,7 +430,7 @@ package body CStand is ...@@ -430,7 +430,7 @@ package body CStand is
-- range False .. True -- range False .. True
-- where the occurrences of the literals must point to the -- where the occurrences of the literals must point to the
-- corresponding definition. -- corresponding definition.
R_Node := New_Node (N_Range, Stloc); R_Node := New_Node (N_Range, Stloc);
B_Node := New_Node (N_Identifier, Stloc); B_Node := New_Node (N_Identifier, Stloc);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -326,7 +326,7 @@ package body Debug is ...@@ -326,7 +326,7 @@ package body Debug is
-- an interepretation is incompatible with the context. -- an interepretation is incompatible with the context.
-- dw Write semantic scope stack messages. Each time a scope is created -- dw Write semantic scope stack messages. Each time a scope is created
-- or removed, a message is output (see the Sem_Ch8.New_Scope and -- or removed, a message is output (see the Sem_Ch8.Push_Scope and
-- Sem_Ch8.Pop_Scope subprograms). -- Sem_Ch8.Pop_Scope subprograms).
-- dx Force expansion on, even if no code being generated. Normally the -- dx Force expansion on, even if no code being generated. Normally the
...@@ -604,15 +604,6 @@ package body Debug is ...@@ -604,15 +604,6 @@ package body Debug is
-- dw Prints the list of units withed by the unit currently explored -- dw Prints the list of units withed by the unit currently explored
-- during the main loop of Make.Compile_Sources. -- during the main loop of Make.Compile_Sources.
----------------------
-- Get_Debug_Flag_K --
----------------------
function Get_Debug_Flag_K return Boolean is
begin
return Debug_Flag_K;
end Get_Debug_Flag_K;
-------------------- --------------------
-- Set_Debug_Flag -- -- Set_Debug_Flag --
-------------------- --------------------
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -179,10 +179,6 @@ package Debug is ...@@ -179,10 +179,6 @@ package Debug is
Debug_Flag_Dot_8 : Boolean := False; Debug_Flag_Dot_8 : Boolean := False;
Debug_Flag_Dot_9 : Boolean := False; Debug_Flag_Dot_9 : Boolean := False;
function Get_Debug_Flag_K return Boolean;
-- This function is called from C code to get the setting of the K flag
-- (it does not work to try to access a constant object directly).
procedure Set_Debug_Flag (C : Character; Val : Boolean := True); procedure Set_Debug_Flag (C : Character; Val : Boolean := True);
-- Where C is 0-9, A-Z, or a-z, sets the corresponding debug flag to -- Where C is 0-9, A-Z, or a-z, sets the corresponding debug flag to
-- the given value. In the checks off version of debug, the call to -- the given value. In the checks off version of debug, the call to
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -310,7 +310,7 @@ package body Exp_Ch8 is ...@@ -310,7 +310,7 @@ package body Exp_Ch8 is
Aux : constant Node_Id := Aux_Decls_Node (Parent (N)); Aux : constant Node_Id := Aux_Decls_Node (Parent (N));
begin begin
New_Scope (Standard_Standard); Push_Scope (Standard_Standard);
if No (Actions (Aux)) then if No (Actions (Aux)) then
Set_Actions (Aux, New_List (Decl)); Set_Actions (Aux, New_List (Decl));
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2000-2006, AdaCore -- -- Copyright (C) 2000-2007, AdaCore --
-- -- -- --
-- 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- --
...@@ -131,12 +131,11 @@ package body GNAT.CGI.Debug is ...@@ -131,12 +131,11 @@ package body GNAT.CGI.Debug is
Result : Unbounded_String; Result : Unbounded_String;
begin begin
Result := Result Result :=
& Title (Mode, "CGI complete runtime environment"); To_Unbounded_String
(Title (Mode, "CGI complete runtime environment")
Result := Result & Header (Mode, "CGI parameters:")
& Header (Mode, "CGI parameters:") & New_Line (Mode));
& New_Line (Mode);
for K in 1 .. Argument_Count loop for K in 1 .. Argument_Count loop
Result := Result Result := Result
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -33,6 +33,7 @@ with Exp_Tss; use Exp_Tss; ...@@ -33,6 +33,7 @@ with Exp_Tss; use Exp_Tss;
with Fname; use Fname; with Fname; use Fname;
with Fname.UF; use Fname.UF; with Fname.UF; use Fname.UF;
with Lib; use Lib; with Lib; use Lib;
with Namet; use Namet;
with Nlists; use Nlists; with Nlists; use Nlists;
with Opt; use Opt; with Opt; use Opt;
with Sem_Ch8; use Sem_Ch8; with Sem_Ch8; use Sem_Ch8;
...@@ -246,12 +247,24 @@ package body Inline is ...@@ -246,12 +247,24 @@ package body Inline is
----------------- -----------------
function Must_Inline return Boolean is function Must_Inline return Boolean is
Scop : Entity_Id := Current_Scope; Scop : Entity_Id;
Comp : Node_Id; Comp : Node_Id;
begin begin
-- Check if call is in main unit -- Check if call is in main unit
Scop := Current_Scope;
-- Do not try to inline if scope is standard. This could happen, for
-- example, for a call to Add_Global_Declaration, and it causes
-- trouble to try to inline at this level.
if Scop = Standard_Standard then
return False;
end if;
-- Otherwise lookup scope stack to outer scope
while Scope (Scop) /= Standard_Standard while Scope (Scop) /= Standard_Standard
and then not Is_Child_Unit (Scop) and then not Is_Child_Unit (Scop)
loop loop
...@@ -259,7 +272,6 @@ package body Inline is ...@@ -259,7 +272,6 @@ package body Inline is
end loop; end loop;
Comp := Parent (Scop); Comp := Parent (Scop);
while Nkind (Comp) /= N_Compilation_Unit loop while Nkind (Comp) /= N_Compilation_Unit loop
Comp := Parent (Comp); Comp := Parent (Comp);
end loop; end loop;
...@@ -271,8 +283,7 @@ package body Inline is ...@@ -271,8 +283,7 @@ package body Inline is
return True; return True;
end if; end if;
-- Call is not in main unit. See if it's in some inlined -- Call is not in main unit. See if it's in some inlined subprogram
-- subprogram.
Scop := Current_Scope; Scop := Current_Scope;
while Scope (Scop) /= Standard_Standard while Scope (Scop) /= Standard_Standard
...@@ -289,7 +300,6 @@ package body Inline is ...@@ -289,7 +300,6 @@ package body Inline is
end loop; end loop;
return False; return False;
end Must_Inline; end Must_Inline;
-- Start of processing for Add_Inlined_Body -- Start of processing for Add_Inlined_Body
...@@ -563,7 +573,7 @@ package body Inline is ...@@ -563,7 +573,7 @@ package body Inline is
Analyzing_Inlined_Bodies := False; Analyzing_Inlined_Bodies := False;
if Serious_Errors_Detected = 0 then if Serious_Errors_Detected = 0 then
New_Scope (Standard_Standard); Push_Scope (Standard_Standard);
J := 0; J := 0;
while J <= Inlined_Bodies.Last while J <= Inlined_Bodies.Last
...@@ -609,7 +619,7 @@ package body Inline is ...@@ -609,7 +619,7 @@ package body Inline is
Error_Msg_N Error_Msg_N
("one or more inlined subprograms accessed in $!", ("one or more inlined subprograms accessed in $!",
Comp_Unit); Comp_Unit);
Error_Msg_Name_1 := Error_Msg_File_1 :=
Get_File_Name (Bname, Subunit => False); Get_File_Name (Bname, Subunit => False);
Error_Msg_N ("\but file{ was not found!", Comp_Unit); Error_Msg_N ("\but file{ was not found!", Comp_Unit);
raise Unrecoverable_Error; raise Unrecoverable_Error;
...@@ -860,7 +870,7 @@ package body Inline is ...@@ -860,7 +870,7 @@ package body Inline is
end if; end if;
end if; end if;
New_Scope (Scop); Push_Scope (Scop);
Expand_Cleanup_Actions (Decl); Expand_Cleanup_Actions (Decl);
End_Scope; End_Scope;
...@@ -935,7 +945,7 @@ package body Inline is ...@@ -935,7 +945,7 @@ package body Inline is
if Serious_Errors_Detected = 0 then if Serious_Errors_Detected = 0 then
Expander_Active := (Operating_Mode = Opt.Generate_Code); Expander_Active := (Operating_Mode = Opt.Generate_Code);
New_Scope (Standard_Standard); Push_Scope (Standard_Standard);
To_Clean := New_Elmt_List; To_Clean := New_Elmt_List;
if Is_Generic_Unit (Cunit_Entity (Main_Unit)) then if Is_Generic_Unit (Cunit_Entity (Main_Unit)) then
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -130,7 +130,7 @@ begin ...@@ -130,7 +130,7 @@ begin
and then (B1 = 'a' or else B1 = 'g' or else B1 = 'i' or else B1 = 's') and then (B1 = 'a' or else B1 = 'g' or else B1 = 'i' or else B1 = 's')
and then Len <= Maxlen and then Len <= Maxlen
then then
-- When VMS is the host, it is always also the target. -- When VMS is the host, it is always also the target
if Hostparm.OpenVMS or else VMS_On_Target then if Hostparm.OpenVMS or else VMS_On_Target then
Len := Len + 1; Len := Len + 1;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -203,17 +203,17 @@ begin ...@@ -203,17 +203,17 @@ begin
-- Line for -we -- Line for -we
Write_Str (" -we treat all Warnings as Errors"); Write_Str (" -we Treat all warnings as errors");
Write_Eol; Write_Eol;
-- Line for -wn -- Line for -wn
Write_Str (" -wn Normal Warning mode (cancels -we/-ws)"); Write_Str (" -wn Normal warning mode (cancels -we/-ws)");
Write_Eol; Write_Eol;
-- Line for -ws -- Line for -ws
Write_Str (" -ws Suppress all Warnings"); Write_Str (" -ws Suppress all warnings");
Write_Eol; Write_Eol;
-- Line for -x -- Line for -x
...@@ -246,7 +246,12 @@ begin ...@@ -246,7 +246,12 @@ begin
-- Source and Library search path switches -- Source and Library search path switches
Write_Str ("Source and Library search path switches:"); Write_Str ("Project, Source and Library search path switches:");
Write_Eol;
-- Line for -aP
Write_Str (" -aPdir Add directory dir to project search path");
Write_Eol; Write_Eol;
-- Line for -aL -- Line for -aL
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -100,6 +100,7 @@ package body MDLL.Utl is ...@@ -100,6 +100,7 @@ package body MDLL.Utl is
Bas_Opt : aliased String := "--base-file"; Bas_Opt : aliased String := "--base-file";
Bas_V : aliased String := Base_File; Bas_V : aliased String := Base_File;
No_Suf_Opt : aliased String := "-k"; No_Suf_Opt : aliased String := "-k";
begin begin
Arguments (1 .. 4) := (1 => Def_Opt'Unchecked_Access, Arguments (1 .. 4) := (1 => Def_Opt'Unchecked_Access,
2 => Def_V'Unchecked_Access, 2 => Def_V'Unchecked_Access,
...@@ -141,7 +142,6 @@ package body MDLL.Utl is ...@@ -141,7 +142,6 @@ package body MDLL.Utl is
Exceptions.Raise_Exception Exceptions.Raise_Exception
(Tools_Error'Identity, Dlltool_Name & " execution error."); (Tools_Error'Identity, Dlltool_Name & " execution error.");
end if; end if;
end Dlltool; end Dlltool;
--------- ---------
...@@ -286,7 +286,7 @@ package body MDLL.Utl is ...@@ -286,7 +286,7 @@ package body MDLL.Utl is
-- Delete binder files -- Delete binder files
declare declare
Base_Name : constant String := Base_Name : constant String :=
Directory_Operations.Base_Name (Ali, ".ali"); Directory_Operations.Base_Name (Ali, ".ali");
begin begin
OS_Lib.Delete_File ("b~" & Base_Name & ".ads", Success); OS_Lib.Delete_File ("b~" & Base_Name & ".ads", Success);
OS_Lib.Delete_File ("b~" & Base_Name & ".adb", Success); OS_Lib.Delete_File ("b~" & Base_Name & ".adb", Success);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -602,8 +602,8 @@ package body Ch5 is ...@@ -602,8 +602,8 @@ package body Ch5 is
Statement_Required := False; Statement_Required := False;
-- A slash following an identifier or a selected -- A slash following an identifier or a selected
-- component in this situation is most likely a -- component in this situation is most likely a period
-- period (have a look at the keyboard :-) -- (see location of keys on keyboard).
elsif Token = Tok_Slash elsif Token = Tok_Slash
and then (Nkind (Name_Node) = N_Identifier and then (Nkind (Name_Node) = N_Identifier
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -417,26 +417,25 @@ package body Tchk is ...@@ -417,26 +417,25 @@ package body Tchk is
return; return;
-- An interesting little kludge here. If the previous token is a -- An interesting little kludge here. If the previous token is a
-- semicolon, then there is no way that we can legitimately need -- semicolon, then there is no way that we can legitimately need another
-- another semicolon. This could only arise in an error situation -- semicolon. This could only arise in an error situation where an error
-- where an error has already been signalled. By simply ignoring -- has already been signalled. By simply ignoring the request for a
-- the request for a semicolon in this case, we avoid some spurious -- semicolon in this case, we avoid some spurious missing semicolon
-- missing semicolon messages. -- messages.
elsif Prev_Token = Tok_Semicolon then elsif Prev_Token = Tok_Semicolon then
return; return;
-- If the current token is | then this is a reasonable -- If the current token is | then this is a reasonable place to suggest
-- place to suggest the possibility of a "C" confusion :-) -- the possibility of a "C" confusion.
elsif Token = Tok_Vertical_Bar then elsif Token = Tok_Vertical_Bar then
Error_Msg_SC ("unexpected occurrence of ""'|"", did you mean OR'?"); Error_Msg_SC ("unexpected occurrence of ""'|"", did you mean OR'?");
Resync_Past_Semicolon; Resync_Past_Semicolon;
return; return;
-- Deal with pragma. If pragma is not at start of line, it is -- Deal with pragma. If pragma is not at start of line, it is considered
-- considered misplaced otherwise we treat it as a normal -- misplaced otherwise we treat it as a normal missing semicolong case.
-- missing semicolong case.
elsif Token = Tok_Pragma elsif Token = Tok_Pragma
and then not Token_Is_At_Start_Of_Line and then not Token_Is_At_Start_Of_Line
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -184,7 +184,7 @@ is ...@@ -184,7 +184,7 @@ is
-- of such a nested region. Again, like case 2, this causes us to miss -- of such a nested region. Again, like case 2, this causes us to miss
-- some nested cases, but it doesn't seen worth the effort to stack and -- some nested cases, but it doesn't seen worth the effort to stack and
-- unstack the SIS information. Maybe we will reconsider this if we ever -- unstack the SIS information. Maybe we will reconsider this if we ever
-- get a complaint about a missed case :-) -- get a complaint about a missed case.
-- 4. We encounter a valid pragma INTERFACE or IMPORT that effectively -- 4. We encounter a valid pragma INTERFACE or IMPORT that effectively
-- supplies the missing body. In this case we reset the entry. -- supplies the missing body. In this case we reset the entry.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with Ada.Exceptions; with Ada.Exceptions;
with System.Exceptions;
package body System.Assertions is package body System.Assertions is
...@@ -41,6 +42,7 @@ package body System.Assertions is ...@@ -41,6 +42,7 @@ package body System.Assertions is
procedure Raise_Assert_Failure (Msg : String) is procedure Raise_Assert_Failure (Msg : String) is
begin begin
System.Exceptions.Debug_Raise_Assert_Failure;
Ada.Exceptions.Raise_Exception (Assert_Failure'Identity, Msg); Ada.Exceptions.Raise_Exception (Assert_Failure'Identity, Msg);
end Raise_Assert_Failure; end Raise_Assert_Failure;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1996-2005 Free Software Foundation, Inc. -- -- Copyright (C) 1996-2006, 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- --
...@@ -62,7 +62,7 @@ package System.Exception_Table is ...@@ -62,7 +62,7 @@ package System.Exception_Table is
-- does not exist yet, null is returned. -- does not exist yet, null is returned.
function Registered_Exceptions_Count return Natural; function Registered_Exceptions_Count return Natural;
-- Return the number of currently registered exceptions. -- Return the number of currently registered exceptions
type Exception_Data_Array is array (Natural range <>) type Exception_Data_Array is array (Natural range <>)
of SSL.Exception_Data_Ptr; of SSL.Exception_Data_Ptr;
...@@ -70,6 +70,6 @@ package System.Exception_Table is ...@@ -70,6 +70,6 @@ package System.Exception_Table is
procedure Get_Registered_Exceptions procedure Get_Registered_Exceptions
(List : out Exception_Data_Array; (List : out Exception_Data_Array;
Last : out Integer); Last : out Integer);
-- Return the list of registered exceptions. -- Return the list of registered exceptions
end System.Exception_Table; end System.Exception_Table;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2001-2003 Free Software Foundation, Inc. -- -- Copyright (C) 2001-2007, 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- --
...@@ -75,8 +75,7 @@ package System.Memory is ...@@ -75,8 +75,7 @@ package System.Memory is
function Realloc function Realloc
(Ptr : System.Address; (Ptr : System.Address;
Size : size_t) Size : size_t) return System.Address;
return System.Address;
-- This is the low level reallocation routine. It takes an existing -- This is the low level reallocation routine. It takes an existing
-- block address returned by a previous call to Alloc or Realloc, -- block address returned by a previous call to Alloc or Realloc,
-- and reallocates the block. The size can either be increased or -- and reallocates the block. The size can either be increased or
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1998-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1998-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNARL is free software; you can redistribute it and/or modify it under -- -- GNARL 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- --
...@@ -47,7 +47,7 @@ package System.OS_Primitives is ...@@ -47,7 +47,7 @@ package System.OS_Primitives is
Duration'Last); Duration'Last);
-- Max of half a year delay, needed to prevent exceptions for large delay -- Max of half a year delay, needed to prevent exceptions for large delay
-- values. It seems unlikely that any test will notice this restriction, -- values. It seems unlikely that any test will notice this restriction,
-- except in the case of applications setting the clock at at run time (see -- except in the case of applications setting the clock at run time (see
-- s-tastim.adb). Also note that a larger value might cause problems (e.g -- s-tastim.adb). Also note that a larger value might cause problems (e.g
-- overflow, or more likely OS limitation in the primitives used). In the -- overflow, or more likely OS limitation in the primitives used). In the
-- case where half a year is too long (which occurs in high integrity mode -- case where half a year is too long (which occurs in high integrity mode
......
...@@ -44,6 +44,7 @@ with System.Rident; ...@@ -44,6 +44,7 @@ with System.Rident;
package System.Restrictions is package System.Restrictions is
pragma Preelaborate; pragma Preelaborate;
pragma Discard_Names; pragma Discard_Names;
package Rident is new System.Rident; package Rident is new System.Rident;
......
...@@ -52,8 +52,7 @@ package System.Soft_Links is ...@@ -52,8 +52,7 @@ package System.Soft_Links is
function Current_Target_Exception return EO; function Current_Target_Exception return EO;
pragma Import pragma Import
(Ada, Current_Target_Exception, (Ada, Current_Target_Exception, "__gnat_current_target_exception");
"__gnat_current_target_exception");
-- Import this subprogram from the private part of Ada.Exceptions -- Import this subprogram from the private part of Ada.Exceptions
-- First we have the access subprogram types used to establish the links. -- First we have the access subprogram types used to establish the links.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2006, 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- --
...@@ -63,24 +63,24 @@ package System.Unsigned_Types is ...@@ -63,24 +63,24 @@ package System.Unsigned_Types is
-- for details. -- for details.
type Packed_Bytes2 is new Packed_Bytes1; type Packed_Bytes2 is new Packed_Bytes1;
for Packed_Bytes2'Alignment use 2; for Packed_Bytes2'Alignment use Integer'Min (2, Standard'Maximum_Alignment);
-- This is the type used to implement packed arrays where an alignment -- This is the type used to implement packed arrays where an alignment
-- of 2 is helpful for maximum efficiency of the get and set routines -- of 2 (is possible) is helpful for maximum efficiency of the get and
-- in the corresponding library unit. This is true of all component -- set routines in the corresponding library unit. This is true of all
-- sizes that are even but not divisible by 4 (other than 2 for which -- component sizes that are even but not divisible by 4 (other than 2 for
-- we use direct masking operations). In such cases, the clusters can -- which we use direct masking operations). In such cases, the clusters
-- be assumed to be 2-byte aligned if the array is aligned. See for -- can be assumed to be 2-byte aligned if the array is aligned. See for
-- example System.Pack_10 in file s-pack10). -- example System.Pack_10 in file s-pack10).
type Packed_Bytes4 is new Packed_Bytes1; type Packed_Bytes4 is new Packed_Bytes1;
for Packed_Bytes4'Alignment use Integer'Min (4, Standard'Maximum_Alignment); for Packed_Bytes4'Alignment use Integer'Min (4, Standard'Maximum_Alignment);
-- This is the type used to implement packed arrays where an alignment -- This is the type used to implement packed arrays where an alignment
-- of 4 is helpful for maximum efficiency of the get and set routines -- of 4 (if possible) is helpful for maximum efficiency of the get and
-- in the corresponding library unit. This is true of all component -- set routines in the corresponding library unit. This is true of all
-- sizes that are divisible by 4 (other than powers of 2, which are -- component sizes that are divisible by 4 (other than powers of 2, which
-- either handled by direct masking or not packed at all). In such cases -- are either handled by direct masking or not packed at all). In such
-- the clusters can be assumed to be 4-byte aligned if the array is -- cases the clusters can be assumed to be 4-byte aligned if the array
-- aligned (see System.Pack_12 in file s-pack12 as an example). -- is aligned (see System.Pack_12 in file s-pack12 as an example).
type Bits_1 is mod 2**1; type Bits_1 is mod 2**1;
type Bits_2 is mod 2**2; type Bits_2 is mod 2**2;
...@@ -92,128 +92,103 @@ package System.Unsigned_Types is ...@@ -92,128 +92,103 @@ package System.Unsigned_Types is
function Shift_Left function Shift_Left
(Value : Short_Short_Unsigned; (Value : Short_Short_Unsigned;
Amount : Natural) Amount : Natural) return Short_Short_Unsigned;
return Short_Short_Unsigned;
function Shift_Right function Shift_Right
(Value : Short_Short_Unsigned; (Value : Short_Short_Unsigned;
Amount : Natural) Amount : Natural) return Short_Short_Unsigned;
return Short_Short_Unsigned;
function Shift_Right_Arithmetic function Shift_Right_Arithmetic
(Value : Short_Short_Unsigned; (Value : Short_Short_Unsigned;
Amount : Natural) Amount : Natural) return Short_Short_Unsigned;
return Short_Short_Unsigned;
function Rotate_Left function Rotate_Left
(Value : Short_Short_Unsigned; (Value : Short_Short_Unsigned;
Amount : Natural) Amount : Natural) return Short_Short_Unsigned;
return Short_Short_Unsigned;
function Rotate_Right function Rotate_Right
(Value : Short_Short_Unsigned; (Value : Short_Short_Unsigned;
Amount : Natural) Amount : Natural) return Short_Short_Unsigned;
return Short_Short_Unsigned;
function Shift_Left function Shift_Left
(Value : Short_Unsigned; (Value : Short_Unsigned;
Amount : Natural) Amount : Natural) return Short_Unsigned;
return Short_Unsigned;
function Shift_Right function Shift_Right
(Value : Short_Unsigned; (Value : Short_Unsigned;
Amount : Natural) Amount : Natural) return Short_Unsigned;
return Short_Unsigned;
function Shift_Right_Arithmetic function Shift_Right_Arithmetic
(Value : Short_Unsigned; (Value : Short_Unsigned;
Amount : Natural) Amount : Natural) return Short_Unsigned;
return Short_Unsigned;
function Rotate_Left function Rotate_Left
(Value : Short_Unsigned; (Value : Short_Unsigned;
Amount : Natural) Amount : Natural) return Short_Unsigned;
return Short_Unsigned;
function Rotate_Right function Rotate_Right
(Value : Short_Unsigned; (Value : Short_Unsigned;
Amount : Natural) Amount : Natural) return Short_Unsigned;
return Short_Unsigned;
function Shift_Left function Shift_Left
(Value : Unsigned; (Value : Unsigned;
Amount : Natural) Amount : Natural) return Unsigned;
return Unsigned;
function Shift_Right function Shift_Right
(Value : Unsigned; (Value : Unsigned;
Amount : Natural) Amount : Natural) return Unsigned;
return Unsigned;
function Shift_Right_Arithmetic function Shift_Right_Arithmetic
(Value : Unsigned; (Value : Unsigned;
Amount : Natural) Amount : Natural) return Unsigned;
return Unsigned;
function Rotate_Left function Rotate_Left
(Value : Unsigned; (Value : Unsigned;
Amount : Natural) Amount : Natural) return Unsigned;
return Unsigned;
function Rotate_Right function Rotate_Right
(Value : Unsigned; (Value : Unsigned;
Amount : Natural) Amount : Natural) return Unsigned;
return Unsigned;
function Shift_Left function Shift_Left
(Value : Long_Unsigned; (Value : Long_Unsigned;
Amount : Natural) Amount : Natural) return Long_Unsigned;
return Long_Unsigned;
function Shift_Right function Shift_Right
(Value : Long_Unsigned; (Value : Long_Unsigned;
Amount : Natural) Amount : Natural) return Long_Unsigned;
return Long_Unsigned;
function Shift_Right_Arithmetic function Shift_Right_Arithmetic
(Value : Long_Unsigned; (Value : Long_Unsigned;
Amount : Natural) Amount : Natural) return Long_Unsigned;
return Long_Unsigned;
function Rotate_Left function Rotate_Left
(Value : Long_Unsigned; (Value : Long_Unsigned;
Amount : Natural) Amount : Natural) return Long_Unsigned;
return Long_Unsigned;
function Rotate_Right function Rotate_Right
(Value : Long_Unsigned; (Value : Long_Unsigned;
Amount : Natural) Amount : Natural) return Long_Unsigned;
return Long_Unsigned;
function Shift_Left function Shift_Left
(Value : Long_Long_Unsigned; (Value : Long_Long_Unsigned;
Amount : Natural) Amount : Natural) return Long_Long_Unsigned;
return Long_Long_Unsigned;
function Shift_Right function Shift_Right
(Value : Long_Long_Unsigned; (Value : Long_Long_Unsigned;
Amount : Natural) Amount : Natural) return Long_Long_Unsigned;
return Long_Long_Unsigned;
function Shift_Right_Arithmetic function Shift_Right_Arithmetic
(Value : Long_Long_Unsigned; (Value : Long_Long_Unsigned;
Amount : Natural) Amount : Natural) return Long_Long_Unsigned;
return Long_Long_Unsigned;
function Rotate_Left function Rotate_Left
(Value : Long_Long_Unsigned; (Value : Long_Long_Unsigned;
Amount : Natural) Amount : Natural) return Long_Long_Unsigned;
return Long_Long_Unsigned;
function Rotate_Right function Rotate_Right
(Value : Long_Long_Unsigned; (Value : Long_Long_Unsigned;
Amount : Natural) Amount : Natural) return Long_Long_Unsigned;
return Long_Long_Unsigned;
pragma Import (Intrinsic, Shift_Left); pragma Import (Intrinsic, Shift_Left);
pragma Import (Intrinsic, Shift_Right); pragma Import (Intrinsic, Shift_Right);
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with System.Pure_Exceptions; use System.Pure_Exceptions;
package body System.WCh_JIS is package body System.WCh_JIS is
type Byte is mod 256; type Byte is mod 256;
...@@ -86,7 +84,7 @@ package body System.WCh_JIS is ...@@ -86,7 +84,7 @@ package body System.WCh_JIS is
-- bit is set in both bytes. -- bit is set in both bytes.
if JIS2 < 16#80# then if JIS2 < 16#80# then
Raise_Exception (CE, "invalid small Katakana character"); raise Constraint_Error;
end if; end if;
EUC1 := Character'Val (EUC_Hankaku_Kana); EUC1 := Character'Val (EUC_Hankaku_Kana);
...@@ -96,7 +94,7 @@ package body System.WCh_JIS is ...@@ -96,7 +94,7 @@ package body System.WCh_JIS is
-- a valid character for representation in EUC form. -- a valid character for representation in EUC form.
elsif JIS1 > 16#7F# or else JIS2 > 16#7F# then elsif JIS1 > 16#7F# or else JIS2 > 16#7F# then
Raise_Exception (CE, "wide character value out of EUC range"); raise Constraint_Error;
-- Result is just the two characters with upper bits set -- Result is just the two characters with upper bits set
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -122,7 +122,7 @@ package Sem_Ch8 is ...@@ -122,7 +122,7 @@ package Sem_Ch8 is
-- S is the entity of a scope. This function determines if this scope -- S is the entity of a scope. This function determines if this scope
-- is currently open (i.e. it appears somewhere in the scope stack). -- is currently open (i.e. it appears somewhere in the scope stack).
procedure New_Scope (S : Entity_Id); procedure Push_Scope (S : Entity_Id);
-- Make new scope stack entry, pushing S, the entity for a scope -- Make new scope stack entry, pushing S, the entity for a scope
-- onto the top of the scope table. The current setting of the scope -- onto the top of the scope table. The current setting of the scope
-- suppress flags is saved for restoration on exit. -- suppress flags is saved for restoration on exit.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -28,9 +28,9 @@ with Atree; use Atree; ...@@ -28,9 +28,9 @@ with Atree; use Atree;
with Einfo; use Einfo; with Einfo; use Einfo;
with Elists; use Elists; with Elists; use Elists;
with Lib; use Lib; with Lib; use Lib;
with Namet; use Namet;
with Nlists; use Nlists; with Nlists; use Nlists;
with Nmake; use Nmake; with Nmake; use Nmake;
with Opt; use Opt;
with Restrict; use Restrict; with Restrict; use Restrict;
with Rident; use Rident; with Rident; use Rident;
with Sinfo; use Sinfo; with Sinfo; use Sinfo;
...@@ -209,10 +209,32 @@ package body Tbuild is ...@@ -209,10 +209,32 @@ package body Tbuild is
Exception_Choices : List_Id; Exception_Choices : List_Id;
Statements : List_Id) return Node_Id Statements : List_Id) return Node_Id
is is
Handler : constant Node_Id := Handler : Node_Id;
Make_Exception_Handler Loc : Source_Ptr;
(Sloc, Choice_Parameter, Exception_Choices, Statements);
begin begin
-- Set the source location only when debugging the expanded code
-- When debugging the source code directly, we do not want the compiler
-- to associate this implicit exception handler with any specific source
-- line, because it can potentially confuse the debugger. The most
-- damaging situation would arise when the debugger tries to insert a
-- breakpoint at a certain line. If the code of the associated implicit
-- exception handler is generated before the code of that line, then the
-- debugger will end up inserting the breakpoint inside the exception
-- handler, rather than the code the user intended to break on. As a
-- result, it is likely that the program will not hit the breakpoint
-- as expected.
if Debug_Generated_Code then
Loc := Sloc;
else
Loc := No_Location;
end if;
Handler :=
Make_Exception_Handler
(Loc, Choice_Parameter, Exception_Choices, Statements);
Set_Local_Raise_Statements (Handler, No_Elist); Set_Local_Raise_Statements (Handler, No_Elist);
return Handler; return Handler;
end Make_Implicit_Exception_Handler; end Make_Implicit_Exception_Handler;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
-- This package contains various utility procedures to assist in -- This package contains various utility procedures to assist in
-- building specific types of tree nodes. -- building specific types of tree nodes.
with Namet; use Namet;
with Types; use Types; with Types; use Types;
package Tbuild is package Tbuild is
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -448,6 +448,10 @@ package body Tree_IO is ...@@ -448,6 +448,10 @@ package body Tree_IO is
procedure Write_Non_Compressed_Sequence; procedure Write_Non_Compressed_Sequence;
-- Output currently collected sequence of non-compressible data -- Output currently collected sequence of non-compressible data
-----------------------------------
-- Write_Non_Compressed_Sequence --
-----------------------------------
procedure Write_Non_Compressed_Sequence is procedure Write_Non_Compressed_Sequence is
begin begin
if NC > 0 then if NC > 0 then
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2007, 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- --
...@@ -1004,9 +1004,7 @@ package body Treepr is ...@@ -1004,9 +1004,7 @@ package body Treepr is
-- Print Etype field if present (printing of this field for entities -- Print Etype field if present (printing of this field for entities
-- is handled by the Print_Entity_Info procedure). -- is handled by the Print_Entity_Info procedure).
if Nkind (N) in N_Has_Etype if Nkind (N) in N_Has_Etype and then Present (Etype (N)) then
and then Present (Etype (N))
then
Print_Str (Prefix_Str_Char); Print_Str (Prefix_Str_Char);
Print_Str ("Etype = "); Print_Str ("Etype = ");
Print_Node_Ref (Etype (N)); Print_Node_Ref (Etype (N));
......
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