diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-07-23 14:41:17 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-07-23 14:41:17 +0200 |
commit | d58b95150676722940a72f068927687a8c7d7391 (patch) | |
tree | d1bacbd76d3b44f50511f0b8738218b94ecd8a35 | |
parent | 3ac489432f87ca7f0570b31d4cae16737cfd48fd (diff) | |
download | gcc-d58b95150676722940a72f068927687a8c7d7391.zip gcc-d58b95150676722940a72f068927687a8c7d7391.tar.gz gcc-d58b95150676722940a72f068927687a8c7d7391.tar.bz2 |
freeze.adb (Set_Small_Size): Remove extra space for consistency with other similar messages.
2009-07-23 Arnaud Charlet <charlet@adacore.com>
* freeze.adb (Set_Small_Size): Remove extra space for consistency with
other similar messages.
* sem_prag.adb (Freeze_Record_Type, Freeze_Entity): Disable error
messages/implicit packing in CodePeer mode.
(Analyze_Pragma [case pragma Pack]): Ignore pragma in CodePeer mode.
* errout.adb (Special_Msg_Delete): Suppress 'size too small' message in
CodePeer mode.
From-SVN: r150005
-rw-r--r-- | gcc/ada/errout.adb | 23 | ||||
-rw-r--r-- | gcc/ada/freeze.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 14 |
3 files changed, 28 insertions, 13 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index f05a4dd..12b491f 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -2768,18 +2768,21 @@ package body Errout is -- message, since it is likely that this size error is a cascaded -- result of other errors. The reason we eliminate unfrozen types -- is that messages issued before the freeze type are for sure OK. + -- Also suppress "size too small" errors in CodePeer mode, since pragma + -- Pack is also ignored in this configuration. elsif Msg = "size for& too small, minimum allowed is ^" - and then Is_Frozen (E) - and then Serious_Errors_Detected > 0 - and then Nkind (N) /= N_Component_Clause - and then Nkind (Parent (N)) /= N_Component_Clause - and then - No (Get_Attribute_Definition_Clause (E, Attribute_Size)) - and then - No (Get_Attribute_Definition_Clause (E, Attribute_Object_Size)) - and then - No (Get_Attribute_Definition_Clause (E, Attribute_Value_Size)) + and then (CodePeer_Mode + or else (Is_Frozen (E) + and then Serious_Errors_Detected > 0 + and then Nkind (N) /= N_Component_Clause + and then Nkind (Parent (N)) /= N_Component_Clause + and then + No (Get_Attribute_Definition_Clause (E, Attribute_Size)) + and then + No (Get_Attribute_Definition_Clause (E, Attribute_Object_Size)) + and then + No (Get_Attribute_Definition_Clause (E, Attribute_Value_Size)))) then return True; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index b4cc4ed..9cd8758 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -593,7 +593,7 @@ package body Freeze is if RM_Size (T) < S then Error_Msg_Uint_1 := S; Error_Msg_NE - ("size for & too small, minimum allowed is ^", + ("size for& too small, minimum allowed is ^", Size_Clause (T), T); elsif Unknown_Esize (T) then @@ -2289,6 +2289,7 @@ package body Freeze is and then not Has_Discriminants (Rec) and then Esize (Rec) < Scalar_Component_Total_Esize and then Esize (Rec) >= Scalar_Component_Total_RM_Size + and then not CodePeer_Mode then -- If implicit packing enabled, do it @@ -3007,6 +3008,7 @@ package body Freeze is and then not Is_Limited_Composite (E) and then not Is_Packed (Root_Type (E)) and then not Has_Component_Size_Clause (Root_Type (E)) + and then not CodePeer_Mode then Get_Index_Bounds (First_Index (E), Lo, Hi); diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index fa07a24..4b4da5f 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -9508,7 +9508,12 @@ package body Sem_Prag is else if not Rep_Item_Too_Late (Typ, N) then - if VM_Target = No_VM then + if CodePeer_Mode then + -- Ignore pragma Pack and disable corresponding + -- complex expansions in CodePeer mode + null; + + 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)); @@ -9524,7 +9529,12 @@ package body Sem_Prag is else pragma Assert (Is_Record_Type (Typ)); if not Rep_Item_Too_Late (Typ, N) then - if VM_Target = No_VM then + if CodePeer_Mode then + -- Ignore pragma Pack and disable corresponding + -- complex expansions in CodePeer mode + null; + + 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)); |