Thread overview
Calling convention
Nov 18, 2020
Jack Applegame
Nov 18, 2020
Elronnd
Nov 18, 2020
Jack Applegame
Nov 18, 2020
Johan
November 18, 2020
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

November 18, 2020
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
November 18, 2020
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.
November 18, 2020
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