[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.