Android/ARM: fixing exception-handling

Dan Olson via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Jul 9 00:43:25 PDT 2015


"Joakim" <dlang at joakim.fea.st> writes:

> On Wednesday, 17 June 2015 at 07:32:35 UTC, Joakim wrote:
> It appears that the only change you made is to turn off passing
> structs by value?
>
> https://github.com/smolt/ldc/blob/ios/gen/abi-ios.cpp#L53

Hi Joakm,

Yes, that little change had a big impact.

http://forum.dlang.org/post/m2r3u5ac0c.fsf@comcast.net

Structs are still passed by value, just in a different way.  The LLVM
"byval" attribute non-inuitively passes a pointer to a struct instead of
passing its contents in registers and stack.

http://llvm.org/docs/LangRef.html#parameter-attributes.  

> The fast C calling convention works for you?  It always caused
> problems for me on ARM, including causing a segfault in llvm when
> compiling, the last time I tried it.

fastcc has worked quite well and an attempt to change to C calling
convention (ccc) led to funny codegen for some aggregate function return
values (e.g complex reals) when optimization was enabled.  But that
problem seemed to go away with LLVM 3.6.

In the end I have abandoned fastcc for ccc with my 0.15.2 and 2.067
merge branches because LDC adopted a different variadic approach and
fastcc doesn't support it.
-- 
Dan


More information about the digitalmars-d-ldc mailing list