From c68c8cb8d4a5a87294df0794471445cfafdb433e Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 17 Oct 2011 21:20:24 +0000 Subject: Add support for the Objective-C personality function to the instruction combining of the landingpad instruction. The ObjC personality function acts almost identically to the C++ personality function. In particular, it uses "null" as a "catch-all" value. llvm-svn: 142256 --- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp') diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 92874b95234..288fe680971 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -1414,7 +1414,8 @@ Instruction *InstCombiner::visitExtractValueInst(ExtractValueInst &EV) { enum Personality_Type { Unknown_Personality, GNU_Ada_Personality, - GNU_CXX_Personality + GNU_CXX_Personality, + GNU_ObjC_Personality }; /// RecognizePersonality - See if the given exception handling personality @@ -1426,7 +1427,8 @@ static Personality_Type RecognizePersonality(Value *Pers) { return Unknown_Personality; return StringSwitch(F->getName()) .Case("__gnat_eh_personality", GNU_Ada_Personality) - .Case("__gxx_personality_v0", GNU_CXX_Personality) + .Case("__gxx_personality_v0", GNU_CXX_Personality) + .Case("__objc_personality_v0", GNU_ObjC_Personality) .Default(Unknown_Personality); } @@ -1440,6 +1442,7 @@ static bool isCatchAll(Personality_Type Personality, Constant *TypeInfo) { // match foreign exceptions (or didn't, before gcc-4.7). return false; case GNU_CXX_Personality: + case GNU_ObjC_Personality: return TypeInfo->isNullValue(); } llvm_unreachable("Unknown personality!"); -- cgit v1.2.3