[Ada] Implement AI12-0028: Import of variadic C functions
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 3 Mar 2020 11:44:18 +0000 (12:44 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 9 Jun 2020 08:09:06 +0000 (04:09 -0400)
commitfd66407104b2133f0e55deb84db787c692a21948
tree628e3735093268193368896af1156e6831f4cb18
parent2d6f6e08e69209d3df5b49b738c08ce3e921bf44
[Ada] Implement AI12-0028: Import of variadic C functions

2020-06-09  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* exp_ch6.adb (Freeze_Subprogram): Deal with convention C_Family.
* freeze.adb (Freeze_Profile): Likewise.  Add missing guard.
* sem_mech.adb (Set_Mechanisms): Likewise.
* lib-xref.adb (Output_Import_Export_Info): Ditto for C_Variadic.
* repinfo.adb (List_Subprogram_Info): Likewise.
* sem_prag.adb (Set_Convention_From_Pragma): Move main checks for
Stdcall to...
(Process_Convention): ...here.  Add checks for C_Variadic.
* snames.ads-tmpl: Add Name_C_Variadic_0 .. Name_C_Variadic_16.
Use consistent format for subtype declarations.
(Convention_Id): Add Convention_C_Variadic_0 .. C_Variadic_16
and move Convention_CPP up.
(Convention_C_Family): New subtype of Convention_Id.
(Convention_C_Variadic): Likewise.
(Foreign_Convention): Use explicit upper bound.
Add pragma Inline for Is_Configuration_Pragma_Name,
Is_Function_Attribute_Name, Is_Internal_Attribute_Name
and Is_Procedure_Attribute_Name.
* snames.adb-tmpl (Get_Convention_Id): Deal with Name_Variadic_n.
(Get_Convention_Name): Deal with Convention_Variadic_n.
* types.h (Convention_Id): New typedef.
* xsnamest.adb (Name2): New variable.
(Is_Conv): New pattern.
(Get_Subt1): Likewise.
(Get_Subt2): Likewise.
Output subtypes of Convention_Id into the C header file.
gcc/ada/exp_ch6.adb
gcc/ada/freeze.adb
gcc/ada/lib-xref.adb
gcc/ada/repinfo.adb
gcc/ada/sem_mech.adb
gcc/ada/sem_prag.adb
gcc/ada/snames.adb-tmpl
gcc/ada/snames.ads-tmpl
gcc/ada/types.h
gcc/ada/xsnamest.adb