This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Various fpt related clean ups


[1] Add d.b debug option for showing available back end types

This debug option prints out information on all types that the
back end indicates it supports.

[2] Allow fpt types with more than Long_Long_Float'Digits digits

This patch takes advantage of the new infrastructure in Cstand to allow
deriving from predefined floating point types that are not in Standard and
may have more than Max_Digits digits. This will allow definition of
Interfaces.C.long_double on systems where this type is not supported by
hardware.

[3] Add support for importing predefined C floating point types

This is needed to reliably define types such as "long double"
which may have no corresponding predefined type in Ada.

The following should compile without error:

procedure it is
   type T;
   pragma Import (C, T, "long double");
begin
   null;
end it;

Tested on x86_64-pc-linux-gnu, committed on trunk

2011-08-02  Geert Bosch  <bosch@adacore.com>

	* cstand.adb (Register_Float_Type): Print information about type to
	register, if the Debug_Flag_Dot_B is set.
	* debug.adb (Debug_Flag_Dot_B): Document d.b debug option.
	* rtsfind.ads (RE_Max_Base_Digits): New run time entity.
	* sem_ch3.adb (Floating_Point_Type_Declaration): Allow declarations
	with a requested precision of more than Max_Digits digits and no more
	than Max_Base_Digits digits, if a range specification is present and the
	Predefined_Float_Types list has a suitable type to derive from.
	* sem_ch3.adb (Rep_Item_Too_Early): Avoid generating error in the
	case of type completion with pragma Import
	* sem_prag.adb
	(Process_Import_Predefined_Type): Processing to complete a type
	with pragma Import. Currently supports floating point types only.
	(Set_Convention_From_Pragma): Do nothing without underlying type.
	(Process_Convention): Guard against absence of underlying type,
	which may happen when importing incomplete types.
	(Process_Import_Or_Interface): Handle case of importing predefined
	types. Tweak error message.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]