From: Piotr Trojanek Date: Mon, 23 Nov 2020 23:05:44 +0000 (+0100) Subject: [Ada] Refactor repeated code for size attributes X-Git-Tag: basepoints/gcc-12~2204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7addd1cec71610bdad23a261e6c2e516eddb3aab;p=thirdparty%2Fgcc.git [Ada] Refactor repeated code for size attributes gcc/ada/ * sem_attr.adb (Analyze_Attribute): Merge identical code for Size, Object_Size and Value_Size attributes. --- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 07719614edc0..308e5cfcd816 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -4766,7 +4766,10 @@ package body Sem_Attr is -- Machine_Size -- ------------------ - when Attribute_Machine_Size => + when Attribute_Machine_Size + | Attribute_Object_Size + | Attribute_Value_Size + => Check_E0; Check_Type; Check_Not_Incomplete_Type; @@ -4993,11 +4996,7 @@ package body Sem_Attr is -- Object_Size -- ----------------- - when Attribute_Object_Size => - Check_E0; - Check_Type; - Check_Not_Incomplete_Type; - Set_Etype (N, Universal_Integer); + -- Shares processing with Machine_Size attribute --------- -- Old -- @@ -7161,11 +7160,7 @@ package body Sem_Attr is -- Value_Size -- ---------------- - when Attribute_Value_Size => - Check_E0; - Check_Type; - Check_Not_Incomplete_Type; - Set_Etype (N, Universal_Integer); + -- Shares processing with Machine_Size attribute ------------- -- Version --