+2010-10-11 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch6.adb (Expand_Actuals): If an actual is the current instance of
+ a task type, it must be replaced with a reference to Self.
+
+2010-10-11 Vincent Celier <celier@adacore.com>
+
+ * adaint.h: Add prototype for function __gnat_create_output_file_new.
+
+2010-10-11 Javier Miranda <miranda@adacore.com>
+
+ * sem_aggr.adb (Collect_Aggr_Bounds): Remove side effects of collected
+ aggregate bounds.
+
2010-10-11 Arnaud Charlet <charlet@adacore.com>
* sem_prag.adb (Check_Interrupt_Or_Attach_Handler): Do not emit error
extern int __gnat_open_rw (char *, int);
extern int __gnat_open_create (char *, int);
extern int __gnat_create_output_file (char *);
+extern int __gnat_create_output_file_new (char *);
+
extern int __gnat_open_append (char *, int);
extern long __gnat_file_length (int);
extern long __gnat_named_file_length (char *);
elsif Is_Possibly_Unaligned_Slice (Actual) then
Add_Call_By_Copy_Code;
+
+ -- An unusual case: a current instance of an enclosing task can be
+ -- an actual, and must be replaced by a reference to self.
+
+ elsif Is_Entity_Name (Actual)
+ and then Is_Task_Type (Entity (Actual))
+ then
+ if In_Open_Scopes (Entity (Actual)) then
+ Rewrite (Actual,
+ (Make_Function_Call (Loc,
+ Name => New_Reference_To (RTE (RE_Self), Loc))));
+ Analyze (Actual);
+
+ -- A task type cannot otherwise appear as an actual
+
+ else
+ raise Program_Error;
+ end if;
end if;
end if;
Is_Fully_Positional : Boolean := True;
procedure Collect_Aggr_Bounds (N : Node_Id; Dim : Pos);
- -- N is an array (sub-)aggregate. Dim is the dimension corresponding to
- -- (sub-)aggregate N. This procedure collects the constrained N_Range
- -- nodes corresponding to each index dimension of our aggregate itype.
+ -- N is an array (sub-)aggregate. Dim is the dimension corresponding
+ -- to (sub-)aggregate N. This procedure collects and removes the side
+ -- effects of the constrained N_Range nodes corresponding to each index
+ -- dimension of our aggregate itype.
-- These N_Range nodes are collected in Aggr_Range above.
--
-- Likewise collect in Aggr_Low & Aggr_High above the low and high
Expr : Node_Id;
begin
+ Remove_Side_Effects (This_Low, Variable_Ref => True);
+ Remove_Side_Effects (This_High, Variable_Ref => True);
+
-- Collect the first N_Range for a given dimension that you find.
-- For a given dimension they must be all equal anyway.