[Ada] Use C++-compatible calling convention on x86/Windows

Eric Botcazou ebotcazou@adacore.com
Tue Jul 3 08:30:00 GMT 2012


> Now reverted, including on the 4.7 branch (this is only for x86/Windows). 
> We have decided to use another approach to deal with the problem as the
> above one introduces backwards compatibily issues.

This is the new approach, which doesn't require modifications to the source 
code and essentially replicates the separation between methods and non-methods
that doesn't exist in Ada.

Tested on i586-suse-linux, applied on mainline and 4.7 branch.


2012-07-03  Eric Botcazou  <ebotcazou@adacore.com>

	* exp_disp.adb (Expand_Dispatching_Call): Propagate the convention on
	the designated subprogram type and also set Is_Dispatch_Table_Entity.
	(Expand_Interface_Thunk): Propagate the convention on the thunk.
	(Set_CPP_Constructors_Old): Set Is_Constructor and Convention_CPP on
	the internal view of the constructors.
	(Set_CPP_Constructors): Likewise.
	* sem_prag.adb (Analyze_Pragma) <Pragma_CPP_Constructor>: Set the
	convention on the function.
     	* gcc-interface/gigi.h (is_cplusplus_method): Declare.
	* gcc-interface/decl.c (Has_Thiscall_Convention): New macro.
	(gnat_to_gnu_entity) <E_Subprogram_Type>: Test it to set the `thiscall'
	calling convention
	(get_minimal_subprog_decl): Likewise.
	(is_cplusplus_method): New predicate.
	* gcc-interface/trans.c (Attribute_to_gnu) <Attr_Access>: Issue an
	error on access to C++ constructor or member function.

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 7771 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120703/950056cd/attachment.bin>


More information about the Gcc-patches mailing list