aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/einfo-utils.adb
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2021-04-09 08:56:23 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2021-06-29 14:23:46 +0000
commitb9ec951f4318f1ed8d8c8d5477eeb534ad0811ae (patch)
tree58fa06ddc61436c57a776eb3099bb86f7f000149 /gcc/ada/einfo-utils.adb
parent0bc7cf47c1266f9ae510c70833b5691c693c769f (diff)
downloadgcc-b9ec951f4318f1ed8d8c8d5477eeb534ad0811ae.zip
gcc-b9ec951f4318f1ed8d8c8d5477eeb534ad0811ae.tar.gz
gcc-b9ec951f4318f1ed8d8c8d5477eeb534ad0811ae.tar.bz2
[Ada] tech debt: clean up Component_Size
gcc/ada/ * einfo.ads (Component_Bit_Offset, Component_Size): Update documentation: Repinfo is the package where these negative values are documented. * einfo-utils.adb (Known_Component_Size, Known_Static_Component_Size, Unknown_Component_Size): Remove calls to Implementation_Base_Type, because Component_Size is an Impl_Base_Type_Only field (see Gen_Entities). * sem_ch13.ads, sem_ch13.adb (Check_Size): Do not set Esize and RM_Size. This is unnecessary in the case of Size. For Component_Size, it is wrong, because we would be setting the Esize and RM_Size of the component type.
Diffstat (limited to 'gcc/ada/einfo-utils.adb')
-rw-r--r--gcc/ada/einfo-utils.adb10
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb
index 0641862..02ccef1 100644
--- a/gcc/ada/einfo-utils.adb
+++ b/gcc/ada/einfo-utils.adb
@@ -515,8 +515,8 @@ package body Einfo.Utils is
function Known_Component_Size (E : Entity_Id) return B is
begin
- return Component_Size (Implementation_Base_Type (E)) /= Uint_0
- and then Component_Size (Implementation_Base_Type (E)) /= No_Uint;
+ return Component_Size (E) /= Uint_0
+ and then Component_Size (E) /= No_Uint;
end Known_Component_Size;
function Known_Esize (E : Entity_Id) return B is
@@ -556,7 +556,7 @@ package body Einfo.Utils is
function Known_Static_Component_Size (E : Entity_Id) return B is
begin
- return Component_Size (Implementation_Base_Type (E)) > Uint_0;
+ return Component_Size (E) > Uint_0;
end Known_Static_Component_Size;
function Known_Static_Esize (E : Entity_Id) return B is
@@ -604,9 +604,7 @@ package body Einfo.Utils is
function Unknown_Component_Size (E : Entity_Id) return B is
begin
- return Component_Size (Implementation_Base_Type (E)) = Uint_0
- or else
- Component_Size (Implementation_Base_Type (E)) = No_Uint;
+ return not Known_Component_Size (E);
end Unknown_Component_Size;
function Unknown_Esize (E : Entity_Id) return B is