OSDN Git Service

2009-07-23 Sergey Rybin <rybin@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / sem_prag.adb
index 4b4da5f..902cb30 100644 (file)
@@ -9508,15 +9508,23 @@ package body Sem_Prag is
 
                else
                   if not Rep_Item_Too_Late (Typ, N) then
+
+                     --  In the context of static code analysis, we do not need
+                     --  complex front-end expansions related to pragma Pack,
+                     --  so disable handling of pragma Pack in this case.
+
                      if CodePeer_Mode then
-                        --  Ignore pragma Pack and disable corresponding
-                        --  complex expansions in CodePeer mode
                         null;
 
+                     --  For normal non-VM target, do the packing
+
                      elsif VM_Target = No_VM then
                         Set_Is_Packed            (Base_Type (Typ));
                         Set_Has_Pragma_Pack      (Base_Type (Typ));
-                        Set_Has_Non_Standard_Rep (Base_Type (Typ));
+                           Set_Has_Non_Standard_Rep (Base_Type (Typ));
+
+                     --  If we ignore the pack, then warn about this, except
+                     --  that we suppress the warning in GNAT mode.
 
                      elsif not GNAT_Mode then
                         Error_Pragma
@@ -9529,12 +9537,7 @@ package body Sem_Prag is
 
             else pragma Assert (Is_Record_Type (Typ));
                if not Rep_Item_Too_Late (Typ, N) then
-                  if CodePeer_Mode then
-                     --  Ignore pragma Pack and disable corresponding
-                     --  complex expansions in CodePeer mode
-                     null;
-
-                  elsif VM_Target = No_VM then
+                  if VM_Target = No_VM then
                      Set_Is_Packed            (Base_Type (Typ));
                      Set_Has_Pragma_Pack      (Base_Type (Typ));
                      Set_Has_Non_Standard_Rep (Base_Type (Typ));