summaryrefslogtreecommitdiff
path: root/gcc/ada/output.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-09 17:19:49 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-09 17:19:49 +0000
commitd5bf49516dfde4e4708fc182e71564ea6875b18e (patch)
tree55fe007ea4d3250009db6cfbba847208f8c1e982 /gcc/ada/output.ads
parent041a8137335bd09376b5cd405c99d1781b7884f1 (diff)
downloadgcc-d5bf49516dfde4e4708fc182e71564ea6875b18e.tar.gz
2005-12-05 Robert Dewar <dewar@adacore.com>
Ed Schonberg <schonberg@adacore.com> Gary Dismukes <dismukes@adacore.com> Javier Miranda <miranda@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> * einfo.adb (Itype_Printed): New flag (Is_Limited_Type): Derived types do not inherit limitedness from interface progenitors. (Is_Return_By_Reference_Type): Predicate does not apply to limited interfaces. * einfo.ads (Itype_Printed): New flag Move Is_Wrapper_Package to proper section Add missing Inline for Is_Volatile * output.ads, output.adb (Write_Erase_Char): New procedure (Save/Restore_Output_Buffer): New procedures (Save/Restore_Output_Buffer): New procedures * sprint.ads, sprint.adb (Write_Itype): Handle case of record itypes Add missing support for anonymous access type (Write_Id): Insert calls to Write_Itype (Write_Itype): New procedure to output itypes * par-ch12.adb (P_Formal_Derived_Type_Definition): In Ada 2005, handle use of "limited" in declaration. * sinfo.ads, sinfo.adb: Formal derived types can carry an explicit "limited" indication. * sem_ch3.adb: Add with and use of Targparm. (Create_Component): If Frontend_Layout_On_Target is True and the copied component does not have a known static Esize, then reset the size and positional fields of the new component. (Analyze_Component_Declaration): A limited component is legal within a protected type that implements an interface. (Collect_Interfaces): Do not add to the list the interfaces that are implemented by the ancestors. (Derived_Type_Declaration): If the parent of the full-view is an interface perform a transformation of the tree to ensure that it has the same parent than the partial-view. This simplifies the job of the expander in order to generate the correct object layout, and it is needed because the list of interfaces of the full-view can be given in any order. (Process_Full_View): The parent of the full-view does not need to be a descendant of the parent of the partial view if both parents are interfaces. (Analyze_Private_Extension_Declaration): If declaration has an explicit "limited" the parent must be a limited type. (Build_Derived_Record_Type): A derived type that is explicitly limited must have limited ancestor and progenitors. (Build_Derived_Type): Ditto. (Process_Full_View): Verify that explicit uses of "limited" in partial and full declarations are consistent. (Find_Ancestor_Interface): Remove function. (Collect_Implemented_Interfaces): New procedure used to gather all implemented interfaces by a type. (Contain_Interface): New function used to check whether an interface is present in a list. (Find_Hidden_Interface): New function used to determine whether two lists of interfaces constitute a set equality. If not, the first differing interface is returned. (Process_Full_View): Improve the check for the "no hidden interface" rule as defined by AI-396. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108295 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/output.ads')
-rw-r--r--gcc/ada/output.ads53
1 files changed, 50 insertions, 3 deletions
diff --git a/gcc/ada/output.ads b/gcc/ada/output.ads
index d69bcb3dcfb..10df6557844 100644
--- a/gcc/ada/output.ads
+++ b/gcc/ada/output.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- 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- --
@@ -35,7 +35,8 @@
-- for writing error messages and informational output. It is also used
-- by the debug source file output routines (see Sprintf.Print_Eol).
-with Types; use Types;
+with Hostparm; use Hostparm;
+with Types; use Types;
package Output is
pragma Elaborate_Body;
@@ -86,6 +87,9 @@ package Output is
-- Write one character to the standard output file. Note that the
-- character should not be LF or CR (use Write_Eol for end of line)
+ procedure Write_Erase_Char (C : Character);
+ -- If last character in buffer matches C, erase it, otherwise no effect
+
procedure Write_Eol;
-- Write an end of line (whatever is required by the system in use,
-- e.g. CR/LF for DOS, or LF for Unix) to the standard output file.
@@ -106,11 +110,30 @@ package Output is
procedure Write_Line (S : String);
-- Equivalent to Write_Str (S) followed by Write_Eol;
- function Column return Nat;
+ function Column return Pos;
pragma Inline (Column);
-- Returns the number of the column about to be written (e.g. a value
-- of 1 means the current line is empty).
+ -------------------------
+ -- Buffer Save/Restore --
+ -------------------------
+
+ -- This facility allows the current line buffer to be saved and restored
+
+ type Saved_Output_Buffer is private;
+ -- Type used for Save/Restore_Buffer
+
+ Buffer_Max : constant := Hostparm.Max_Line_Length;
+ -- Maximal size of a buffered output line
+
+ function Save_Output_Buffer return Saved_Output_Buffer;
+ -- Save current line buffer and reset line buffer to empty
+
+ procedure Restore_Output_Buffer (S : Saved_Output_Buffer);
+ -- Restore previously saved output buffer. The value in S is not affected
+ -- so it is legtimate to restore a buffer more than once.
+
--------------------------
-- Debugging Procedures --
--------------------------
@@ -144,4 +167,28 @@ package Output is
procedure w (L : String; B : Boolean);
-- Dump contents of string followed by blank, Boolean, line return
+private
+ -- Note: the following buffer and column position are maintained by the
+ -- subprograms defined in this package, and cannot be directly modified or
+ -- accessed by a client.
+
+ Buffer : String (1 .. Buffer_Max + 1);
+ for Buffer'Alignment use 4;
+ -- Buffer used to build output line. We do line buffering because it
+ -- is needed for the support of the debug-generated-code option (-gnatD).
+ -- Historically it was first added because on VMS, line buffering is
+ -- needed with certain file formats. So in any case line buffering must
+ -- be retained for this purpose, even if other reasons disappear. Note
+ -- any attempt to write more output to a line than can fit in the buffer
+ -- will be silently ignored. The alignment clause improves the efficiency
+ -- of the save/restore procedures.
+
+ Next_Col : Positive range 1 .. Buffer'Length + 1 := 1;
+ -- Column about to be written
+
+ type Saved_Output_Buffer is record
+ Buffer : String (1 .. Buffer_Max + 1);
+ Next_Col : Positive;
+ end record;
+
end Output;