aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/doc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-06-23 12:49:04 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-16 03:31:15 -0400
commitc7c7dd3a1ded3f8bcdbfb352277246a521108710 (patch)
tree3cee854425c54f59389e7c436adcdaad865cfe96 /gcc/ada/doc
parent429ad0bb0d3dc77e44f95620341da4938d49168e (diff)
downloadgcc-c7c7dd3a1ded3f8bcdbfb352277246a521108710.zip
gcc-c7c7dd3a1ded3f8bcdbfb352277246a521108710.tar.gz
gcc-c7c7dd3a1ded3f8bcdbfb352277246a521108710.tar.bz2
[Ada] Add Max_Integer_Size attribute and couple of helper functions
gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst: Document the new Max_Integer_Size attribute. * gnat_rm.texi: Regenerate. * exp_attr.adb (Get_Integer_Type): Call Small_Integer_Type_For. (Expand_N_Attribute_Reference) <Attribute_Pred>: Replace selection code with call to Integer_Type_For. <Attribute_Succ>: Likewise. <Attribute_Val>: Likewise. <Attribute_Valid>: Likewise. <Attribute_Max_Integer_Size>: Raise Program_Error. * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Replace selection code with call to Integer_Type_For. (Simple_Init_Initialize_Scalars_Type): Use Long_Long_Unsigned and System_Max_Integer_Size to size the largest integer type. * exp_pakd.adb (Compute_Linear_Subscript): Minor tweak. (Create_Packed_Array_Impl_Type): Use Small_Integer_Type_For. * exp_util.ads (Integer_Type_For): New function. (Small_Integer_Type_For): Likewise. * exp_util.adb (Adjust_Condition): Use Integer_Type_For. (Component_May_Be_Bit_Aligned): Use System_Max_Integer_Size. (Integer_Type_For): New function. (Small_Integer_Type_For): Likewise. (Matching_Standard_Type): Use Small_Integer_Type_For. (Needs_Constant_Address): Replace 64 with System_Max_Integer_Size. * freeze.adb (Set_Small_Size): Likewise. (Size_Known): Likewise. (Check_Suspicious_Modulus): Likewise. (Check_Large_Modular_Array): Likewise. (Freeze_Entity): Likewise. * layout.adb (Layout_Type): Likewise. * sem_aggr.adb: Add with and use clauses for Ttypes. (Resolve_Aggregate): Replace 64 with System_Max_Integer_Size. * sem_attr.ads (Attribute_Impl_Def): Add Attribute_Max_Integer_Size. * sem_attr.adb (Analyze_Attribute) <Attribute_Max_Integer_Size>: New (Eval_Attribute): Likewise. * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Change max scalar size to System_Max_Integer_Size. (Check_Array_Type): Replace 64 with System_Max_Integer_Size and remove superfluous test. (OK_Component): Likewise. * sem_ch5.adb: Add with and use clauses for Ttypes. (Analyze_Assignment): Replace 64 with System_Max_Integer_Size. * snames.ads-tmpl (Name_Max_Integer_Size): New attribute name. (Attribute_Id): Add Attribute_Max_Integer_Size. * ttypes.ads (System_Max_Integer_Size): New constant.
Diffstat (limited to 'gcc/ada/doc')
-rw-r--r--gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst b/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst
index 967e9d9..f98a427 100644
--- a/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst
+++ b/gcc/ada/doc/gnat_rm/implementation_defined_attributes.rst
@@ -657,6 +657,14 @@ target. This is a static value that can be used to specify the alignment
for an object, guaranteeing that it is properly aligned in all
cases.
+Attribute Max_Integer_Size
+==========================
+.. index:: Max_Integer_Size
+
+``Standard'Max_Integer_Size`` (``Standard`` is the only permissible
+prefix) provides the size of the largest supported integer type for
+the target. The result is a static constant.
+
Attribute Mechanism_Code
========================
.. index:: Return values, passing mechanism