summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Wodnicki <pawel@32bitmicro.com>2012-11-26 21:20:28 +0000
committerPawel Wodnicki <pawel@32bitmicro.com>2012-11-26 21:20:28 +0000
commit3f9ebe0fb43630f26708458eb46e543b481472c4 (patch)
tree25cb973e90cd85055385b7fc9c12f6d3c258d7d4
parentefed6ba03aecdc6ec6a061fc21897bd7daeee1c9 (diff)
Merging r167935: into the 3.2 release branch.
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_32@168611 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGException.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp
index 369711a8a6..86dee5a4ab 100644
--- a/lib/CodeGen/CGException.cpp
+++ b/lib/CodeGen/CGException.cpp
@@ -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)