diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-01-23 21:52:19 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-04 05:11:05 -0400 |
commit | d2f87b22d1e47859166efc90eda830d21a0c31b9 (patch) | |
tree | d5d1a2a010403c4c1022050da1c3aa46bb95eb62 | |
parent | a0c94bd34a4ed6b8239d9a6d749ad5c94022acff (diff) | |
download | gcc-d2f87b22d1e47859166efc90eda830d21a0c31b9.zip gcc-d2f87b22d1e47859166efc90eda830d21a0c31b9.tar.gz gcc-d2f87b22d1e47859166efc90eda830d21a0c31b9.tar.bz2 |
[Ada] Set convention and inlined flag on default null procedure
2020-06-04 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* sem_attr.adb (Resolve_Attribute) <Access>: Do not generate
the secondary message about a missing pragma if the convention
of the prefix is Intrinsic.
* sem_ch12.adb (Instantiate_Formal_Subprogram): Only set the
Convention and the Is_Inlined flag on a null procedure.
-rw-r--r-- | gcc/ada/sem_attr.adb | 1 | ||||
-rw-r--r-- | gcc/ada/sem_ch12.adb | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 07f0117..005add8c 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -10678,6 +10678,7 @@ package body Sem_Attr is if not Is_Itype (Btyp) and then not Has_Convention_Pragma (Btyp) + and then Convention (Entity (P)) /= Convention_Intrinsic then Error_Msg_FE ("\probable missing pragma Convention for &", diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 49a8720..1068056 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -10785,7 +10785,13 @@ package body Sem_Ch12 is Make_Handled_Sequence_Of_Statements (Loc, Statements => New_List (Make_Null_Statement (Loc)))); - Set_Is_Intrinsic_Subprogram (Defining_Unit_Name (New_Spec)); + -- RM 12.6 (16 2/2): The procedure has convention Intrinsic + + Set_Convention (Defining_Unit_Name (New_Spec), Convention_Intrinsic); + + -- Eliminate the calls to it when optimization is enabled + + Set_Is_Inlined (Defining_Unit_Name (New_Spec)); return Decl_Node; else |