[PATCH] D12743: [CodeGen] Teach SimplifyPersonality about the updated LandingPadInst

John McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 11 13:15:34 PDT 2015


rjmccall added a comment.

In http://reviews.llvm.org/D12743#244375, @vsk wrote:

> Ah, ok. We have some objective-c++ code which calls into a boost routine which throws an exception. That results in an undefined reference to ___objc_personality_v0, because the boost library we linked against doesn't have ___objc_personality_v0.
>
> Should the compiler have found the ___objc_personality_v0 symbol in this case regardless?


It's pretty straightforward.  Sometimes people write code in ObjC++ files that's really pure C++.  Such code is generally compiled with -fexceptions because that's the default, and so it has cleanups, and those cleanups require us to pick a personality function.  When they do so, they generally don't link against the ObjC runtime, and so __objc_personality_v0 isn't found.  The workaround here is to recognize that they're not actually catching ObjC exception types and just quietly degrade to use the C++ personality.

It is probably technically an optimization, because it removes some overhead from double-parsing the exception tables (because the ObjC personality delegates to the C++ personality, instead of being tightly integrated with it), but that's not the real reason we do it.


Repository:
  rL LLVM

http://reviews.llvm.org/D12743





More information about the cfe-commits mailing list