* sem_attr.adb, s-os_lib.ads, prj-tree.adb: Minor reformatting.
* types.h: Fix typo.
2014-07-18 Robert Dewar <dewar@adacore.com>
* freeze.adb (Check_Address_Clause): Use Kill_Rep_Clause (no
functional change).
* gnat_ugn.texi: Document that -gnatI removes rep clauses from
ASIS trees.
* sem_ch13.adb (Kill_Rep_Clause): New procedure
(Analyze_Attribute_Definition_Clause): Use
Kill_Rep_Clause. This is just a cleanup, no functional effect.
(Analyze_Enumeration_Representation_Clause):
Use Kill_Rep_Clause. This means that enum rep
clauses are now properly removed from -gnatct trees.
(Analyze_Record_Representation_Clause): Same change.
* sem_ch13.ads (Kill_Rep_Clause): New procedure.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212789
138bc75d-0d04-0410-961f-
82ee72b054a4
+2014-07-18 Robert Dewar <dewar@adacore.com>
+
+ * sem_attr.adb, s-os_lib.ads, prj-tree.adb: Minor reformatting.
+ * types.h: Fix typo.
+
+2014-07-18 Robert Dewar <dewar@adacore.com>
+
+ * freeze.adb (Check_Address_Clause): Use Kill_Rep_Clause (no
+ functional change).
+ * gnat_ugn.texi: Document that -gnatI removes rep clauses from
+ ASIS trees.
+ * sem_ch13.adb (Kill_Rep_Clause): New procedure
+ (Analyze_Attribute_Definition_Clause): Use
+ Kill_Rep_Clause. This is just a cleanup, no functional effect.
+ (Analyze_Enumeration_Representation_Clause):
+ Use Kill_Rep_Clause. This means that enum rep
+ clauses are now properly removed from -gnatct trees.
+ (Analyze_Record_Representation_Clause): Same change.
+ * sem_ch13.ads (Kill_Rep_Clause): New procedure.
+
2014-07-18 Pascal Obry <obry@adacore.com>
* s-os_lib.ads, s-os_lib.adb (GM_Time_Of): New routine to create an
end if;
end;
- Rewrite (Addr, Make_Null_Statement (Sloc (E)));
+ -- And now remove the address clause
+
+ Kill_Rep_Clause (Addr);
elsif not Error_Posted (Expr)
and then not Needs_Finalization (Typ)
Note that this option should be used only for compiling -- the
code is likely to malfunction at run time.
+Note that when @code{-gnatct} is used to generate trees for input
+into @code{ASIS} tools, these representation clauses are removed
+from the tree. This means that the tool will not see them. For
+example, if you use @command{gnatpp} with @code{-gnatI}, the pretty printed
+output will not include the ignored representation clauses.
+
@item -gnatjnn
@cindex @option{-gnatjnn} (@command{gcc})
Reformat error messages to fit on nn character lines
In_Tree : Project_Node_Tree_Ref;
With_Name : Name_Id) return Project_Node_Id
is
- With_Clause : Project_Node_Id :=
- First_With_Clause_Of (Project, In_Tree);
+ With_Clause : Project_Node_Id;
Result : Project_Node_Id := Empty_Node;
begin
-- First check all the imported projects
+ With_Clause := First_With_Clause_Of (Project, In_Tree);
while Present (With_Clause) loop
- -- Only non limited imported project may be used as prefix
- -- of variable or attributes.
+ -- Only non limited imported project may be used as prefix of
+ -- variables or attributes.
Result := Non_Limited_Project_Node_Of (With_Clause, In_Tree);
-
while Present (Result) loop
if Name_Of (Result, In_Tree) = With_Name then
return Result;
Hour : Hour_Type;
Minute : Minute_Type;
Second : Second_Type) return OS_Time;
- -- Analogous to the Time_Of routine in Ada.Calendar, takes a set of
- -- time component parts and returns an OS_Time. Returns Invalid_Time
- -- if the creation fails.
+ -- Analogous to the Time_Of routine in Ada.Calendar, takes a set of time
+ -- component parts and returns an OS_Time. Returns Invalid_Time if the
+ -- creation fails.
----------------
-- File Stuff --
Hi := High_Bound (Index);
Analyze_And_Resolve (Lo, Etype (Index_Type));
+
if not Is_OK_Static_Expression (Lo) then
Set_Do_Range_Check (Lo);
end if;
Analyze_And_Resolve (Hi, Etype (Index_Type));
+
if not Is_OK_Static_Expression (Hi) then
Set_Do_Range_Check (Hi);
end if;
Attribute_Machine_Radix |
Attribute_Object_Size |
Attribute_Size |
+ Attribute_Small |
Attribute_Stream_Size |
Attribute_Value_Size =>
- Rewrite (N, Make_Null_Statement (Sloc (N)));
+ Kill_Rep_Clause (N);
return;
- -- Perhaps 'Small should not be ignored by Ignore_Rep_Clauses ???
-
- when Attribute_Small =>
- if Ignore_Rep_Clauses then
- Rewrite (N, Make_Null_Statement (Sloc (N)));
- return;
- end if;
-
-- The following should not be ignored, because in the first place
-- they are reasonably portable, and should not cause problems in
-- compiling code from another target, and also they do affect
Attribute_Write =>
null;
+ -- We do not do anything here with address clauses, they will be
+ -- removed by Freeze later on, but for now, it works better to
+ -- keep then in the tree.
+
+ when Attribute_Address =>
+ null;
+
-- Other cases are errors ("attribute& cannot be set with
-- definition clause"), which will be caught below.
-- Even when ignoring rep clauses we need to indicate that the
-- entity has an address clause and thus it is legal to declare
- -- it imported.
+ -- it imported. Freeze will get rid of the address clause later.
if Ignore_Rep_Clauses then
if Ekind_In (U_Ent, E_Variable, E_Constant) then
begin
if Ignore_Rep_Clauses then
+ Kill_Rep_Clause (N);
return;
end if;
begin
if Ignore_Rep_Clauses then
+ Kill_Rep_Clause (N);
return;
end if;
end if;
end Is_Operational_Item;
+ ---------------------
+ -- Kill_Rep_Clause --
+ ---------------------
+
+ procedure Kill_Rep_Clause (N : Node_Id) is
+ begin
+ pragma Assert (Ignore_Rep_Clauses);
+ Rewrite (N, Make_Null_Statement (Sloc (N)));
+ end Kill_Rep_Clause;
+
------------------
-- Minimum_Size --
------------------
procedure Initialize;
-- Initialize internal tables for new compilation
+ procedure Kill_Rep_Clause (N : Node_Id);
+ -- This procedure is called for a rep clause N when we are in -gnatI mode
+ -- (Ignore_Rep_Clauses). It rewrites the node N to a null statement. This
+ -- is only called if Ignore_Rep_Clauses is True.
+
procedure Set_Enum_Esize (T : Entity_Id);
-- This routine sets the Esize field for an enumeration type T, based
-- on the current representation information available for T. Note that
* *
* C Header File *
* *
- * Copyright (C) 1992-2013, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2014, 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- *
#define PE_Address_Of_Intrinsic 16
#define PE_Aliased_Parameters 17
#define PE_All_Guards_Closed 18
-#define PE_Bad_Attribute_For_Predicate 19
+#define PE_Bad_Predicated_Generic_Type 19
#define PE_Current_Task_In_Entry_Body 20
#define PE_Duplicated_Entry_Address 21
#define PE_Explicit_Raise 22