summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-11-14 17:48:31 +0000
committerJohn McCall <rjmccall@apple.com>2012-11-14 17:48:31 +0000
commit3c2239356c4eb6f3c3633db7fb4b8891f9cb4e25 (patch)
tree7489e8e14bc0c940b708b6b0e2ea7a393b770c2a /clang/lib/CodeGen
parent983ae49a9254a92a8c45d8dab953af94ad4c1b01 (diff)
downloadbcm5719-llvm-3c2239356c4eb6f3c3633db7fb4b8891f9cb4e25.tar.gz
bcm5719-llvm-3c2239356c4eb6f3c3633db7fb4b8891f9cb4e25.zip
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
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGException.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 369711a8a62..86dee5a4ab9 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/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)
OpenPOWER on IntegriCloud