The ObjC++-to-C++ personality trick is only necessary on NeXT runtimes,

which is not coincidentally the only place it works, either (because
of how it tests for EH_TYPE symbols).

llvm-svn: 167935
This commit is contained in:
John McCall 2012-11-14 17:48:31 +00:00
parent 983ae49a92
commit 3c2239356c
1 changed files with 5 additions and 4 deletions

View File

@ -307,14 +307,15 @@ static bool PersonalityHasOnlyCXXUses(llvm::Constant *Fn) {
/// aggressive about only using the ObjC++ personality in a function
/// when it really needs it.
void CodeGenModule::SimplifyPersonality() {
// For now, this is really a Darwin-specific operation.
if (!Context.getTargetInfo().getTriple().isOSDarwin())
return;
// If we're not in ObjC++ -fexceptions, there's nothing to do.
if (!LangOpts.CPlusPlus || !LangOpts.ObjC1 || !LangOpts.Exceptions)
return;
// Both the problem this endeavors to fix and the way the logic
// above works is specific to the NeXT runtime.
if (!LangOpts.ObjCRuntime.isNeXTFamily())
return;
const EHPersonality &ObjCXX = EHPersonality::get(LangOpts);
const EHPersonality &CXX = getCXXPersonality(LangOpts);
if (&ObjCXX == &CXX)