+2010-10-11 Robert Dewar <dewar@adacore.com>
+
+ * debug.adb: Remove d.A flag to delay address clause (not needed any
+ more). Add d.A flag to enable tree read/write of aspect spec hash table
+ * sem_ch13.adb (Analyze_Aspect_Specifications): Properly delay address
+ clause.
+ (Rep_Item_Too_Late): No need for special processing for delayed rep
+ items (and it caused difficulties in the address case).
+ * tree_gen.adb: Only write aspect spec hash table if -gnatd.A is set
+ * tree_in.adb: Only write aspect spec hash table if -gnatd.A is set
+
+2010-10-11 Pat Rogers <rogers@adacore.com>
+
+ * gnat_ugn.texi: Minor editing.
+
2010-10-11 Nathan Froyd <froydnj@codesourcery.com>
* gcc-interface/utils2.c (gnat_build_constructor): Use VEC_qsort.
-- d.y
-- d.z
- -- d.A Properly defer address aspect
+ -- d.A Read/write Aspect_Specifications hash table to tree
-- d.B
-- d.C Generate concatenation call, do not generate inline code
-- d.D
-- d.w This flag turns off the scanning of loops to detect possible
-- infinite loops.
- -- d.A Properly defer address aspect. In the case where the expression
- -- of an address aspect is non-static, we should defer the evaluation
- -- of the expression till the freeze point, but this does not seem to
- -- work properly. So we have this debug switch temporarily so that we
- -- can easily investigate this problem.
+ -- d.A There seems to be a problem with ASIS if we activate the circuit
+ -- for reading and writing the aspect specification hash table, so
+ -- for now, this is controlled by the debug flag d.A. The hash table
+ -- is only written and read if this flag is set.
-- d.x No exception handlers in generated code. This causes exception
-- handlers to be eliminated from the generated code. They are still
@table @option
@c !sort!
@item -gnatwa
-@emph{Activate all optional errors.}
+@emph{Activate most optional warnings.}
@cindex @option{-gnatwa} (@command{gcc})
-This switch activates most optional warning messages, see remaining list
+This switch activates most optional warning messages. See the remaining list
in this section for details on optional warning messages that can be
individually controlled. The warnings that are not turned on by this
switch are
@item
@cindex pragma Inline
@findex Inline
-Either @code{pragma Inline} applies to the subprogram and the
-@option{^-gnatn^/INLINE^} switch is used on the command line, or it is local
-to the unit and called once from within it, or it is small and optimization
-level @option{-O2} is specified, or automatic inlining (optimization level
-@option{-O3}) is specified.
+Any one of the following applies: @code{pragma Inline} is applied to the
+subprogram and the @option{^-gnatn^/INLINE^} switch is specified; the
+subprogram is local to the unit and called once from within it; the
+subprogram is small and optimization level @option{-O2} is specified;
+optimization level @option{-O3}) is specified.
@end itemize
@noindent
with Aspects; use Aspects;
with Atree; use Atree;
with Checks; use Checks;
-with Debug; use Debug;
with Einfo; use Einfo;
with Elists; use Elists;
with Errout; use Errout;
-- Aspects corresponding to attribute definition clauses with
-- the exception of Address which is treated specially.
- when Aspect_Alignment |
+ when Aspect_Address |
+ Aspect_Alignment |
Aspect_Bit_Order |
Aspect_Component_Size |
Aspect_External_Tag |
-- Preanalyze the expression with the appropriate type
case A_Id is
+ when Aspect_Address =>
+ T := RTE (RE_Address);
when Aspect_Bit_Order =>
T := RTE (RE_Bit_Order);
when Aspect_External_Tag =>
Delay_Required := True;
end if;
- -- Address aspect, treated specially because we have some
- -- strange problem in the back end if we try to delay ???
-
- when Aspect_Address =>
-
- -- Construct the attribute definition clause
-
- Aitem :=
- Make_Attribute_Definition_Clause (Sloc (Aspect),
- Name => Ent,
- Chars => Chars (Id),
- Expression => Relocate_Node (Expr));
-
- -- If -gnatd.A is set, do the delay if needed (this is
- -- so we can debug the relevant problem).
-
- if Debug_Flag_Dot_AA then
- Preanalyze_Spec_Expression
- (Expression (Aitem), RTE (RE_Address));
-
- if Is_OK_Static_Expression (Expression (Aitem)) then
- Delay_Required := False;
- else
- Delay_Required := True;
- end if;
-
- -- Here if -gnatd.A not set, never do the delay
-
- else
- Delay_Required := False;
- end if;
-
-- Aspects corresponding to pragmas with two arguments, where
-- the first argument is a local name referring to the entity,
-- and the second argument is the aspect definition expression.
A : Node_Id;
begin
- -- Nothing to do if this attribute definition clause comes from an
- -- aspect specification, since we could not be duplicating an
+ -- Nothing to do if this attribute definition clause comes from
+ -- an aspect specification, since we could not be duplicating an
-- explicit clause, and we dealt with the case of duplicated aspects
-- in Analyze_Aspect_Specifications.
-- Start of processing for Rep_Item_Too_Late
begin
- -- If this is from an aspect that was delayed till the freeze point,
- -- then we skip this check entirely, since it is not required and
- -- furthermore can generate false errors. Also we don't need to chain
- -- the item into the rep item chain in that case, it is already there!
-
- if Nkind_In (N, N_Attribute_Definition_Clause, N_Pragma)
- and then Is_Delayed_Aspect (N)
- then
- return False;
- end if;
-
-- First make sure entity is not frozen (RM 13.1(9)). Exclude imported
-- types, which may be frozen if they appear in a representation clause
-- for a local type.
with Aspects;
with Atree;
+with Debug;
with Elists;
with Fname;
with Lib;
if Opt.Tree_Output then
Osint.C.Tree_Create;
Opt.Tree_Write;
- Aspects.Tree_Write;
+
+ -- For now, only write aspect specifications hash table if -gnatd.A set
+
+ if Debug.Debug_Flag_Dot_AA then
+ Aspects.Tree_Write;
+ end if;
+
Atree.Tree_Write;
Elists.Tree_Write;
Fname.Tree_Write;
with Aspects;
with Atree;
with Csets;
+with Debug;
with Elists;
with Fname;
with Lib;
begin
Tree_IO.Tree_Read_Initialize (Desc);
Opt.Tree_Read;
- Aspects.Tree_Read;
+
+ -- For now, only read aspect specifications hash table if -gnatd.A is set
+
+ if Debug.Debug_Flag_Dot_AA then
+ Aspects.Tree_Read;
+ end if;
+
Atree.Tree_Read;
Elists.Tree_Read;
Fname.Tree_Read;