OSDN Git Service

2008-08-04 Kevin Pouget <pouget@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / exp_attr.adb
index 8e0a83b..890f09b 100644 (file)
@@ -33,6 +33,7 @@ with Exp_Ch2;  use Exp_Ch2;
 with Exp_Ch3;  use Exp_Ch3;
 with Exp_Ch6;  use Exp_Ch6;
 with Exp_Ch9;  use Exp_Ch9;
+with Exp_Dist; use Exp_Dist;
 with Exp_Imgv; use Exp_Imgv;
 with Exp_Pakd; use Exp_Pakd;
 with Exp_Strm; use Exp_Strm;
@@ -2075,6 +2076,22 @@ package body Exp_Attr is
          Expand_Fpt_Attribute_R (N);
 
       --------------
+      -- From_Any --
+      --------------
+
+      when Attribute_From_Any => From_Any : declare
+         P_Type : constant Entity_Id := Etype (Pref);
+         Decls  : constant List_Id   := New_List;
+      begin
+         Rewrite (N,
+           Build_From_Any_Call (P_Type,
+             Relocate_Node (First (Exprs)),
+             Decls));
+         Insert_Actions (N, Decls);
+         Analyze_And_Resolve (N, P_Type);
+      end From_Any;
+
+      --------------
       -- Identity --
       --------------
 
@@ -4396,6 +4413,22 @@ package body Exp_Attr is
              Relocate_Node (First (Exprs))));
          Analyze_And_Resolve (N, RTE (RE_Address));
 
+      ------------
+      -- To_Any --
+      ------------
+
+      when Attribute_To_Any => To_Any : declare
+         P_Type : constant Entity_Id := Etype (Pref);
+         Decls  : constant List_Id   := New_List;
+      begin
+         Rewrite (N,
+           Build_To_Any_Call
+             (Convert_To (P_Type,
+              Relocate_Node (First (Exprs))), Decls));
+         Insert_Actions (N, Decls);
+         Analyze_And_Resolve (N, RTE (RE_Any));
+      end To_Any;
+
       ----------------
       -- Truncation --
       ----------------
@@ -4409,6 +4442,19 @@ package body Exp_Attr is
             Expand_Fpt_Attribute_R (N);
          end if;
 
+      --------------
+      -- TypeCode --
+      --------------
+
+      when Attribute_TypeCode => TypeCode : declare
+         P_Type : constant Entity_Id := Etype (Pref);
+         Decls  : constant List_Id   := New_List;
+      begin
+         Rewrite (N, Build_TypeCode_Call (Loc, P_Type, Decls));
+         Insert_Actions (N, Decls);
+         Analyze_And_Resolve (N, RTE (RE_TypeCode));
+      end TypeCode;
+
       -----------------------
       -- Unbiased_Rounding --
       -----------------------