www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Calling convention

reply Jack Applegame <japplegame gmail.com> writes:
I work with the ARM platform and I need to specify AAPCS [1] 
calling convention.
Clang and GCC support `__attribute__((__pcs__("aapcs")))` [2].

How to specify this calling convention?

[1] https://developer.arm.com/documentation/ihi0042/latest/
[2] 
https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/builtins/int_lib.h#L27
Nov 17 2020
parent reply Elronnd <elronnd elronnd.net> writes:
You may be interested in ldc.attributes.llvmAttr.

https://wiki.dlang.org/LDC-specific_language_changes#.40.28ldc.attributes.llvmAttr.28.22key.22.2C_.22value.22.29.29
Nov 18 2020
parent reply Jack Applegame <japplegame gmail.com> writes:
On Wednesday, 18 November 2020 at 20:35:37 UTC, Elronnd wrote:
 You may be interested in ldc.attributes.llvmAttr.

 https://wiki.dlang.org/LDC-specific_language_changes#.40.28ldc.attributes.llvmAttr.28.22key.22.2C_.22value.22.29.29
I already tried llvmAttr("pcs", "aapcs") and llvmAttr("__pcs__", "aapcs"), but nothing changed.
Nov 18 2020
parent Johan <j j.nl> writes:
On Wednesday, 18 November 2020 at 21:58:44 UTC, Jack Applegame 
wrote:
 On Wednesday, 18 November 2020 at 20:35:37 UTC, Elronnd wrote:
 You may be interested in ldc.attributes.llvmAttr.

 https://wiki.dlang.org/LDC-specific_language_changes#.40.28ldc.attributes.llvmAttr.28.22key.22.2C_.22value.22.29.29
I already tried llvmAttr("pcs", "aapcs") and llvmAttr("__pcs__", "aapcs"), but nothing changed.
Calling conventions cannot be added with llvmAttr. We need a new magic attribute for it. -Johan
Nov 18 2020