d: Add TARGET_D_HAS_STDCALL_CONVENTION
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 5 Apr 2021 16:46:18 +0000 (18:46 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Wed, 14 Apr 2021 12:43:37 +0000 (14:43 +0200)
commitd253a6f7bb1748405bd9d12967f40dc19c8f77c4
tree5521bbeda5815da04d1f8cd76efb8095ffe99aa2
parent3330e673959d44e5c7663956803e1e7a703dd626
d: Add TARGET_D_HAS_STDCALL_CONVENTION

This replaces the use of the D front-end `is64bit' parameter in
determining whether to insert the "stdcall" function attribute.

It is also used to determine whether `extern(System)' should be the same
as `extern(Windows)' in the implementation of Target::systemLinkage.

gcc/ChangeLog:

* config/i386/i386-d.c (ix86_d_has_stdcall_convention): New function.
* config/i386/i386-protos.h (ix86_d_has_stdcall_convention): Declare.
* config/i386/i386.h (TARGET_D_HAS_STDCALL_CONVENTION): Define.
* doc/tm.texi: Regenerate.
* doc/tm.texi.in (D language and ABI): Add @hook for
TARGET_D_HAS_STDCALL_CONVENTION.

gcc/d/ChangeLog:

* d-target.cc (Target::systemLinkage): Return LINKwindows if
d_has_stdcall_convention applies to LINKsystem.
* d-target.def (d_has_stdcall_convention): New hook.
* types.cc (TypeVisitor::visit (TypeFunction *)): Insert "stdcall"
function attribute if d_has_stdcall_convention applies to LINKwindows.
gcc/config/i386/i386-d.c
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.h
gcc/d/d-target.cc
gcc/d/d-target.def
gcc/d/types.cc
gcc/doc/tm.texi
gcc/doc/tm.texi.in