iphone + LDC, a new ARM adventure

Dan Olson zans.is.for.cans at yahoo.com
Wed Jan 8 09:39:19 PST 2014


Dan Olson <zans.is.for.cans at yahoo.com> writes:

> I'll spend some more time over the next few days and see what clang
> does to make the sjlj pass happy.
>
> Thanks for all the help so far,

I looked at what clang does different on i686-apple-darwin and
arm-apple-darwin and one thing that changed when targeting ios is a
bitcast on the personality function.  So I edited the results of ldc2
-output-l:

From:
  %landing_pad = landingpad { i8*, i32 } personality i32 (i32, i32, i64, i8*, i8*)* @_d_eh_personality

To:
  %landing_pad = landingpad { i8*, i32 } personality i8* bitcast (i32 (i32, i32, i64, i8*, i8*)* @_d_eh_personality to i8*)

Then ran llc on the modified file.  No assertion and I get arm assemble
code!  And it looks reasonable to my untrained eye.

By the way, llc is very cool.  As I said, I am totally new to llvm
internals, so am having fun learning what it has in its magic bag of
tricks.

So far I cannot find where clang adds the bitcast thing for sjlj eh
personality.  I will keep hunting.  Any ideas where I would do this in
ldc?

When it comes to updating the _d_eh_personality for sjlj, I noticed a
very small difference in the c++ versions ( _gxx_personality_v0 and
_gxx_personality_sj0).  It is actually one funtion body in

gcc-4.8-20121028/libstdc++-v3/libsupc++/eh_personality.cc

with a little extra code in an ifdef _GLIBCXX_SJLJ_EXCEPTIONS
conditional.

Dan


More information about the digitalmars-d-ldc mailing list