aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-11-24 00:05:44 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2020-12-15 06:41:52 -0500
commit7addd1cec71610bdad23a261e6c2e516eddb3aab (patch)
treed15fc01b62ff0562fd4eaad563ceb07403191618
parent57d5ceda2f8669bd36be135176e9e7ee416df7df (diff)
downloadgcc-7addd1cec71610bdad23a261e6c2e516eddb3aab.zip
gcc-7addd1cec71610bdad23a261e6c2e516eddb3aab.tar.gz
gcc-7addd1cec71610bdad23a261e6c2e516eddb3aab.tar.bz2
[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.
-rw-r--r--gcc/ada/sem_attr.adb17
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 0771961..308e5cf 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 --