diff options
author | Gary Dismukes <dismukes@adacore.com> | 2022-03-08 18:21:48 -0500 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-16 08:42:04 +0000 |
commit | 21f8b410511d1ee9a46b7a902a368762f6256ea0 (patch) | |
tree | 02d1a1c310fd0467e88c1ca9cb1735d09e0674bb /gcc/ada/init.c | |
parent | ae745a0de34892d0d1e7157292628c375a94221f (diff) | |
download | gcc-21f8b410511d1ee9a46b7a902a368762f6256ea0.zip gcc-21f8b410511d1ee9a46b7a902a368762f6256ea0.tar.gz gcc-21f8b410511d1ee9a46b7a902a368762f6256ea0.tar.bz2 |
[Ada] Revise Storage_Model_Support operations to do checks and take objects and types
The functions in subpackage Storage_Model_Support (apart from the
Has_*_Aspect functions) are revised to have assertions that will fail
when passed a parameter that doesn't specify the appropriate aspect
(either aspect Storage_Model_Type or Designated_Storage_Model), instead
of returning Empty for bad arguments. Also, various of the functions now
allow either a type with aspect Storage_Model_Type or an object of such
a type.
gcc/ada/
* sem_util.ads (Storage_Model_Support): Revise comments on most
operations within this nested package to reflect that they can
now be passed either a type that has aspect Storage_Model_Type
or an object of such a type. Change the names of the relevant
formals to SM_Obj_Or_Type. Also, add more precise semantic
descriptions in some cases, and declare the subprograms in a
more logical order.
* sem_util.adb (Storage_Model_Support.Storage_Model_Object): Add
an assertion that the type must specify aspect
Designated_Storage_Model, rather than returning Empty when it
doesn't specify that aspect.
(Storage_Model_Support.Storage_Model_Type): Add an assertion
that formal must be an object whose type specifies aspect
Storage_Model_Type, rather than returning Empty for when it
doesn't have such a type (and test Has_Storage_Model_Type_Aspect
rather than Find_Value_Of_Aspect).
(Storage_Model_Support.Get_Storage_Model_Type_Entity): Allow
both objects and types, and add an assertion that the type (or
the type of the object) has a value for aspect
Storage_Model_Type.
Diffstat (limited to 'gcc/ada/init.c')
0 files changed, 0 insertions, 0 deletions