* exp_ch9.adb (Install_Private_Data_Declarations): Add guards
which ensure that restriction No_Dynamic_Attachment has not been
violated.
(Make_Initialize_Protection): Protected types with attach or
interrupt handlers must not violate restriction No_Dynamic_Attachment.
* exp_util.adb (Corresponding_Runtime_Package): Add a guard
which ensures that restriction No_Dynamic_Attachment has not been
violated.
* sem_attr.adb: (Eval_Attribute): Transform
VAX_Float_Type'First and 'Last into references to
the temporaries which store the corresponding bounds. The
transformation is needed since the back end cannot evaluate
'First and 'Last on VAX.
(Is_VAX_Float): New routine.
2011-09-02 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Analyze_Subprogram_Instantiation): If the
generic unit is not intrinsic and has an explicit convention,
the instance inherits it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178449
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-09-02 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch9.adb (Install_Private_Data_Declarations): Add guards
+ which ensure that restriction No_Dynamic_Attachment has not been
+ violated.
+ (Make_Initialize_Protection): Protected types with attach or
+ interrupt handlers must not violate restriction No_Dynamic_Attachment.
+ * exp_util.adb (Corresponding_Runtime_Package): Add a guard
+ which ensures that restriction No_Dynamic_Attachment has not been
+ violated.
+ * sem_attr.adb: (Eval_Attribute): Transform
+ VAX_Float_Type'First and 'Last into references to
+ the temporaries which store the corresponding bounds. The
+ transformation is needed since the back end cannot evaluate
+ 'First and 'Last on VAX.
+ (Is_VAX_Float): New routine.
+
+2011-09-02 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch12.adb (Analyze_Subprogram_Instantiation): If the
+ generic unit is not intrinsic and has an explicit convention,
+ the instance inherits it.
+
2011-09-02 Robert Dewar <dewar@adacore.com>
* prj-dect.adb, prj-env.adb, prj-nmsc.adb, prj-proc.adb, prj-tree.adb,
if Has_Attach_Handler (Conc_Typ)
and then not Restricted_Profile
+ and then not Restriction_Active (No_Dynamic_Attachment)
then
Prot_Typ := RE_Static_Interrupt_Protection;
- elsif Has_Interrupt_Handler (Conc_Typ) then
+ elsif Has_Interrupt_Handler (Conc_Typ)
+ and then not Restriction_Active (No_Dynamic_Attachment)
+ then
Prot_Typ := RE_Dynamic_Interrupt_Protection;
-- The type has explicit entries or generated primitive entry
-- When no priority is specified but an xx_Handler pragma is, we default
-- to System.Interrupts.Default_Interrupt_Priority, see D.3(10).
- elsif Has_Interrupt_Handler (Ptyp)
- or else Has_Attach_Handler (Ptyp)
+ elsif (Has_Attach_Handler (Ptyp) or else Has_Interrupt_Handler (Ptyp))
+ and then not Restriction_Active (No_Dynamic_Attachment)
then
Append_To (Args,
New_Reference_To (RTE (RE_Default_Interrupt_Priority), Loc));
-- context of dispatching select statements.
if Has_Entry
- or else Has_Interrupt_Handler (Ptyp)
- or else Has_Attach_Handler (Ptyp)
or else Has_Interfaces (Protect_Rec)
+ or else
+ ((Has_Attach_Handler (Ptyp) or else Has_Interrupt_Handler (Ptyp))
+ and then not Restriction_Active (No_Dynamic_Attachment))
then
declare
Pkg_Id : constant RTU_Id :=
if Ekind (Typ) in Protected_Kind then
if Has_Entries (Typ)
- or else Has_Interrupt_Handler (Typ)
- or else (Has_Attach_Handler (Typ)
- and then not Restricted_Profile)
-- A protected type without entries that covers an interface and
-- overrides the abstract routines with protected procedures is
-- node to recognize this case.
or else Present (Interface_List (Parent (Typ)))
+ or else
+ (((Has_Attach_Handler (Typ) and then not Restricted_Profile)
+ or else Has_Interrupt_Handler (Typ))
+ and then not Restriction_Active (No_Dynamic_Attachment))
then
if Abort_Allowed
or else Restriction_Active (No_Entry_Queue) = False
-- Computes the Fore value for the current attribute prefix, which is
-- known to be a static fixed-point type. Used by Fore and Width.
+ function Is_VAX_Float (Typ : Entity_Id) return Boolean;
+ -- Determine whether Typ denotes a VAX floating point type
+
function Mantissa return Uint;
-- Returns the Mantissa value for the prefix type
return R;
end Fore_Value;
+ ------------------
+ -- Is_VAX_Float --
+ ------------------
+
+ function Is_VAX_Float (Typ : Entity_Id) return Boolean is
+ begin
+ return
+ Is_Floating_Point_Type (Typ)
+ and then
+ (Float_Format = 'V'
+ or else Float_Rep (Typ) = VAX_Native);
+ end Is_VAX_Float;
+
--------------
-- Mantissa --
--------------
Fold_Uint (N, Expr_Value (Lo_Bound), Static);
end if;
+ -- Replace VAX Float_Type'First with a reference to the temporary
+ -- which represents the low bound of the type. This transformation
+ -- is needed since the back end cannot evaluate 'First on VAX.
+
+ elsif Is_VAX_Float (P_Type)
+ and then Nkind (Lo_Bound) = N_Identifier
+ then
+ Rewrite (N, New_Reference_To (Entity (Lo_Bound), Sloc (N)));
+ Analyze (N);
+
else
Check_Concurrent_Discriminant (Lo_Bound);
end if;
Fold_Uint (N, Expr_Value (Hi_Bound), Static);
end if;
+ -- Replace VAX Float_Type'Last with a reference to the temporary
+ -- which represents the high bound of the type. This transformation
+ -- is needed since the back end cannot evaluate 'Last on VAX.
+
+ elsif Is_VAX_Float (P_Type)
+ and then Nkind (Hi_Bound) = N_Identifier
+ then
+ Rewrite (N, New_Reference_To (Entity (Hi_Bound), Sloc (N)));
+ Analyze (N);
+
else
Check_Concurrent_Discriminant (Hi_Bound);
end if;
-- for the compilation, we generate the instance body even if it is
-- not within the main unit.
- -- Any other pragmas might also be inherited ???
-
if Is_Intrinsic_Subprogram (Gen_Unit) then
Set_Is_Intrinsic_Subprogram (Anon_Id);
Set_Is_Intrinsic_Subprogram (Act_Decl_Id);
end if;
end if;
+ -- Inherit convention from generic unit. Intrinsic convention, as for
+ -- an instance of unchecked conversion, is not inherited because an
+ -- explicit Ada instance has been created.
+
+ if Has_Convention_Pragma (Gen_Unit)
+ and then Convention (Gen_Unit) /= Convention_Intrinsic
+ then
+ Set_Convention (Act_Decl_Id, Convention (Gen_Unit));
+ Set_Is_Exported (Act_Decl_Id, Is_Exported (Gen_Unit));
+ end if;
+
Generate_Definition (Act_Decl_Id);
Set_Contract (Anon_Id, Make_Contract (Sloc (Anon_Id))); -- ??? needed?
Set_Contract (Act_Decl_Id, Make_Contract (Sloc (Act_Decl_Id)));
Check_Hidden_Child_Unit (N, Gen_Unit, Act_Decl_Id);
- -- Subject to change, pending on if other pragmas are inherited ???
-
Validate_Categorization_Dependency (N, Act_Decl_Id);
if not Is_Intrinsic_Subprogram (Act_Decl_Id) then