[PATCH] D12743: [CodeGen] Teach SimplifyPersonality about the updated LandingPadInst
Vedant Kumar via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 11 10:33:31 PDT 2015
vsk added a comment.
I think 'optimization' is a bit of a misnomer. There's a comment in this code that reads: "Can't do the optimization if it has non-C++ uses", so that's why I picked up the word. Without SimplifyPersonality(), some objective c++ code can no longer link against c++ libraries.
Consider the following test:
$ echo "#include <stdexcept>" "\n" 'void foo() { throw std::runtime_error("foo"); }' | clang -x objective-cxx -S -emit-llvm - -o - | grep personality
After we moved personality from landingpadinst to functions, the output of the test changes (from __gxx_personality to __objc_personality). This commit just takes us back to the original behavior.
The original comment, "Otherwise, it has to be a landingpad instruction.", is wrong after David's patch.
http://reviews.llvm.org/D12743
More information about the cfe-commits
mailing list