+2009-07-22 Brett Porter <porter@adacore.com>
+
+ * init.c (__gnat_init_float): For SPE, set bits in SPEFSCR instead of
+ FPSCR.
+ * sysdep.c (__gnat_get_task_options): Set task option enabling SPE.
+
+2009-07-22 Gary Dismukes <dismukes@adacore.com>
+
+ * exp_ch5.adb, sem_util.adb, sem_attr.adb, exp_dbug.ads, exp_ch2.adb,
+ exp_tss.ads, exp_ch4.adb, sem_ch4.adb: Correct spelling error.
+ Minor reformatting.
+ * sem_res.adb (Resolve_Explicit_Dereference): Reword one comment that
+ used poor terminology.
+
+2009-07-22 Robert Dewar <dewar@adacore.com>
+
+ * freeze.adb, sem_ch3.adb, sem_prag.adb: Minor reformatting
+ * sem_eval.adb, exp_tss.adb: Minor comment update.
+ * stylesw.adb: Code clean up.
+
2009-07-22 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Freeze_Entity): If Implicit_Packing is enabled, and the
-- For all types of parameters, the constructed parameter record object
-- contains a pointer to the parameter. Thus we must dereference them to
- -- access them (this will often be redundant, since the needed deference
- -- is implicit, but no harm is done by making it explicit).
+ -- access them (this will often be redundant, since the dereference is
+ -- implicit, but no harm is done by making it explicit).
Rewrite (N,
Make_Explicit_Dereference (Loc, P_Comp_Ref));
end if;
-- If the prefix is an access type, then we unconditionally rewrite if
- -- as an explicit deference. This simplifies processing for several
+ -- as an explicit dereference. This simplifies processing for several
-- cases, including packed array cases and certain cases in which checks
-- must be generated. We used to try to do this only when it was
-- necessary, but it cleans up the code to do it all the time.
-- do this, we get the wrong length computed for the array to be
-- moved. The two cases we need to worry about are:
- -- Explicit deference of an unconstrained packed array type as in the
- -- following example:
+ -- Explicit dereference of an unconstrained packed array type as in
+ -- the following example:
-- procedure C52 is
-- type BITS is array(INTEGER range <>) of BOOLEAN;
-- Here f is the field name for the selection
- -- For an explicit deference (.all), we have a single entry
+ -- For an explicit dereference (.all), we have a single entry
-- XA
-- The following codes are used to denote TSSs:
- -- Note: When making additions to this list, update the list in snames.adb
+ -- Note: When making additions to this list, update the list in
+ -- snames.adb-tmpl
type TSS_Name_Type is new String (1 .. 2);
subtype TNT is TSS_Name_Type;
TSS_From_Any : constant TNT := "FA"; -- PolyORB/DSA From_Any
TSS_Init_Proc : constant TNT := "IP"; -- Initialization Procedure
TSS_RAS_Access : constant TNT := "RA"; -- RAS type access
- TSS_RAS_Dereference : constant TNT := "RD"; -- RAS type deference
+ TSS_RAS_Dereference : constant TNT := "RD"; -- RAS type dereference
TSS_Rep_To_Pos : constant TNT := "RP"; -- Rep to Pos conversion
TSS_Slice_Assign : constant TNT := "SA"; -- Slice assignment
TSS_Stream_Input : constant TNT := "SI"; -- Stream Input attribute
exception
when Cannot_Be_Static =>
- -- If the object that cannot be static is imported or exported,
- -- then we give an error message saying that this object cannot
- -- be imported or exported. If it has an address clause it is
- -- an overlay in the current partition and the static requirement
- -- is not relevant.
-
- if Is_Imported (E)
- and then No (Address_Clause (E))
- then
+ -- If the object that cannot be static is imported or exported, then
+ -- issue an error message saying that this object cannot be imported
+ -- or exported. If it has an address clause it is an overlay in the
+ -- current partition and the static requirement is not relevant.
+
+ if Is_Imported (E) and then No (Address_Clause (E)) then
Error_Msg_N
("& cannot be imported (local type is not constant)", E);
overflow settings are an OS configuration issue. The instructions
below have no effect. */
#if defined (_ARCH_PPC) && !defined (_SOFT_FLOAT) && !defined (VTHREADS)
+#if defined (_SPE_)
+ {
+ const unsigned long spefscr_mask = 0xfffffff3;
+ unsigned long spefscr;
+ asm ("mfspr %0, 512" : "=r" (spefscr));
+ spefscr = spefscr & spefscr_mask;
+ asm ("mtspr 512, %0\n\tisync" : : "r" (spefscr));
+ }
+#else
asm ("mtfsb0 25");
asm ("mtfsb0 26");
#endif
+#endif
#if (defined (__i386__) || defined (i386)) && !defined (VTHREADS)
/* This is used to properly initialize the FPU on an x86 for each
procedure Check_Dereference;
-- If the prefix of attribute is an object of an access type, then
- -- introduce an explicit deference, and adjust P_Type accordingly.
+ -- introduce an explicit dereference, and adjust P_Type accordingly.
procedure Check_Discrete_Type;
-- Verify that prefix of attribute N is a discrete type
Check_Not_Incomplete_Type;
Set_Etype (N, RTE (RE_Type_Class));
- ------------
- -- To_Any --
- ------------
+ --------------
+ -- TypeCode --
+ --------------
when Attribute_TypeCode =>
Check_E0;
if Present (Prev_Entity)
and then
- -- If the homograph is an implicit subprogram, it is overridden
- -- by the current declaration.
+ -- If the homograph is an implicit subprogram, it is overridden
+ -- by the current declaration.
((Is_Overloadable (Prev_Entity)
- and then Is_Inherited_Operation (Prev_Entity))
+ and then Is_Inherited_Operation (Prev_Entity))
-- The current object is a discriminal generated for an entry
-- family index. Even though the index is a constant, in this
or else
(Ekind (Prev_Entity) = E_Package
- and then
- Nkind (Parent (Prev_Entity)) = N_Package_Renaming_Declaration
- and then
- not Comes_From_Source (Prev_Entity)
- and then
- Is_Generic_Instance (Renamed_Entity (Prev_Entity))))
+ and then Nkind (Parent (Prev_Entity)) =
+ N_Package_Renaming_Declaration
+ and then not Comes_From_Source (Prev_Entity)
+ and then Is_Generic_Instance (Renamed_Entity (Prev_Entity))))
then
Prev_Entity := Empty;
end if;
Set_Etype (N, Etype (Comp));
Set_Etype (Nam, It.Typ);
- -- For access type case, introduce explicit deference for
- -- more uniform treatment of entry calls. Do this only
- -- once if several interpretations yield an access type.
+ -- For access type case, introduce explicit dereference for
+ -- more uniform treatment of entry calls. Do this only once
+ -- if several interpretations yield an access type.
if Is_Access_Type (Etype (Nam))
and then Nkind (Nam) /= N_Explicit_Dereference
Set_Original_Discriminant (Sel, Comp);
end if;
- -- For access type case, introduce explicit deference for more
- -- uniform treatment of entry calls.
+ -- For access type case, introduce explicit dereference for
+ -- more uniform treatment of entry calls.
if Is_Access_Type (Etype (Name)) then
Insert_Explicit_Dereference (Name);
-- the context to determine that Any_Integer is meant.
----------------------------
- -- To_Any_Integer_Context --
+ -- In_Any_Integer_Context --
----------------------------
function In_Any_Integer_Context return Boolean is
Check_Arg_Count (0);
Check_Valid_Configuration_Pragma;
- -- Normalize_Scalars creates false positives in CodePeer,
- -- so ignore this pragma in this mode.
+ -- Normalize_Scalars creates false positives in CodePeer, so
+ -- ignore this pragma in this mode.
if not CodePeer_Mode then
Normalize_Scalars := True;
and then (Ekind (Entity (N)) /= E_Enumeration_Literal
or else Is_Overloaded (N)))
- -- Rewrite as call if it is an explicit deference of an expression of
+ -- Rewrite as call if it is an explicit dereference of an expression of
-- a subprogram access type, and the subprogram type is not that of a
-- procedure or entry.
Set_Etype (N, Get_Actual_Subtype (N));
end if;
- -- Note: there is no Eval processing required for an explicit deference,
- -- because the type is known to be an allocators, and allocator
- -- expressions can never be static.
+ -- Note: No Eval processing is required for an explicit dereference,
+ -- because such a name can never be static.
end Resolve_Explicit_Dereference;
if Is_Overloaded (New_Prefix) then
- -- The deference is also overloaded, and its interpretations are the
- -- designated types of the interpretations of the original node.
+ -- The dereference is also overloaded, and its interpretations are
+ -- the designated types of the interpretations of the original node.
Set_Etype (N, Any_Type);
package body Stylesw is
+ -- The following constant defines the default style options for -gnaty
+
+ Default_Style : constant String :=
+ "3" & -- indentation level is 3
+ "a" & -- check attribute casing
+ "A" & -- check array attribute indexes
+ "b" & -- check no blanks at end of lines
+ "c" & -- check comment formats
+ "e" & -- check end/exit labels present
+ "f" & -- check no form/feeds vertical tabs in source
+ "h" & -- check no horizontal tabs in source
+ "i" & -- check if-then layout
+ "k" & -- check casing rules for keywords
+ "l" & -- check reference manual layout
+ "m" & -- check line length <= 79 characters
+ "n" & -- check casing of package Standard idents
+ "p" & -- check pragma casing
+ "r" & -- check casing for identifier references
+ "s" & -- check separate subprogram specs present
+ "t"; -- check token separation rules
+
+ -- The following constant defines the GNAT style options, showing them
+ -- as additions to the standard default style check options.
+
+ GNAT_Style : constant String := Default_Style &
+ "d" & -- check no DOS line terminators
+ "I" & -- check mode IN
+ "S" & -- check separate lines after THEN or ELSE
+ "u" & -- check no unnecessary blank lines
+ "x"; -- check extra parentheses around conditionals
+
-------------------------------
-- Reset_Style_Check_Options --
-------------------------------
procedure Set_Default_Style_Check_Options is
begin
Reset_Style_Check_Options;
- Set_Style_Check_Options ("3aAbcefhiklmnprst");
+ Set_Style_Check_Options (Default_Style);
end Set_Default_Style_Check_Options;
----------------------------------
procedure Set_GNAT_Style_Check_Options is
begin
Reset_Style_Check_Options;
- Set_Style_Check_Options ("3aAbcdefhiIklmnprsStux");
+ Set_Style_Check_Options (GNAT_Style);
end Set_GNAT_Style_Check_Options;
-----------------------------
function returns the options to be set when creating a new task. It fetches
the options assigned to the current task (parent), so offering some user
level control over the options for a task hierarchy. It forces VX_FP_TASK
- because it is almost always required. */
+ because it is almost always required. On processors with the SPE
+ category, VX_SPE_TASK is needed to enable the SPE. */
extern int __gnat_get_task_options (void);
int
/* Force VX_FP_TASK because it is almost always required */
options |= VX_FP_TASK;
+#if defined (_SPE_)
+ options |= VX_SPE_TASK;
+#endif
/* Mask those bits that are not under user control */
#ifdef VX_USR_TASK_OPTIONS