-- --
-- B o d y --
-- --
--- $Revision: 1.304 $
-- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2002 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- --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Sem; use Sem;
with Sem_Ch7; use Sem_Ch7;
with Sem_Ch8; use Sem_Ch8;
-with Sem_Ch13; use Sem_Ch13;
with Sem_Eval; use Sem_Eval;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
declare
Agg : Node_Id;
Sub : Entity_Id;
- E_T : constant Entity_Id := Equivalent_Type (Typ);
+ E_T : constant Entity_Id := Equivalent_Type (Btyp);
Acc : constant Entity_Id :=
Etype (Next_Component (First_Component (E_T)));
Obj_Ref : Node_Id;
Rewrite (N, Agg);
- Analyze_And_Resolve (N, Equivalent_Type (Typ));
+ Analyze_And_Resolve (N, E_T);
-- For subsequent analysis, the node must retain its type.
-- The backend will replace it with the equivalent type where
Ttyp := Underlying_Type (Ttyp);
if Prefix_Is_Type then
- Rewrite (N,
- Unchecked_Convert_To (RTE (RE_Tag),
- New_Reference_To (Access_Disp_Table (Ttyp), Loc)));
+
+ -- For JGNAT we leave the type attribute unexpanded because
+ -- there's not a dispatching table to reference.
+
+ if not Java_VM then
+ Rewrite (N,
+ Unchecked_Convert_To (RTE (RE_Tag),
+ New_Reference_To (Access_Disp_Table (Ttyp), Loc)));
+ Analyze_And_Resolve (N, RTE (RE_Tag));
+ end if;
else
Rewrite (N,
Prefix => Relocate_Node (Pref),
Selector_Name =>
New_Reference_To (Tag_Component (Ttyp), Loc)));
+ Analyze_And_Resolve (N, RTE (RE_Tag));
end if;
-
- Analyze_And_Resolve (N, RTE (RE_Tag));
end Tag;
----------------
Attribute_Machine_Overflows |
Attribute_Machine_Radix |
Attribute_Machine_Rounds |
- Attribute_Max_Interrupt_Priority |
- Attribute_Max_Priority |
Attribute_Maximum_Alignment |
Attribute_Model_Emin |
Attribute_Model_Epsilon |
Attribute_Signed_Zeros |
Attribute_Small |
Attribute_Storage_Unit |
- Attribute_Tick |
Attribute_Type_Class |
Attribute_Universal_Literal_String |
Attribute_Wchar_T_Size |
Make_Attribute_Reference (Loc,
Prefix =>
New_Reference_To (Base_Type (Etype (Prefix (N))), Loc),
- Attribute_Name => Cnam))));
+ Attribute_Name => Cnam)),
+ Reason => CE_Overflow_Check_Failed));
end Expand_Pred_Succ;
-- If Typ is a derived type, it may inherit attributes from some
-- ancestor which is not the ultimate underlying one.
+ -- If Typ is a derived tagged type, the corresponding primitive
+ -- operation has been created explicitly.
if Is_Derived_Type (P_Type) then
+ if Is_Tagged_Type (P_Type) then
+ return Find_Prim_Op (P_Type, Nam);
+ else
+ while Is_Derived_Type (P_Type) loop
+ Proc := TSS (Base_Type (Etype (Typ)), Nam);
- while Is_Derived_Type (P_Type) loop
- Proc := TSS (Base_Type (Etype (Typ)), Nam);
-
- if Present (Proc) then
- return Proc;
- else
- P_Type := Base_Type (Etype (P_Type));
- end if;
- end loop;
+ if Present (Proc) then
+ return Proc;
+ else
+ P_Type := Base_Type (Etype (P_Type));
+ end if;
+ end loop;
+ end if;
end if;
-- If nothing else, use the TSS of the root type.