ARMv7k: simplify logic for deciding sjlj-exceptions.
authorTim Northover <tnorthover@apple.com>
Wed, 27 Jan 2016 22:14:02 +0000 (22:14 +0000)
committerTim Northover <tnorthover@apple.com>
Wed, 27 Jan 2016 22:14:02 +0000 (22:14 +0000)
Slight change of behaviour in the odd armv7+watchos case, which should match
the other runtime components.

llvm-svn: 258994

clang/lib/Driver/ToolChains.cpp
clang/test/Driver/arch-armv7k.c

index 4f72a96..45cd8bd 100644 (file)
@@ -1076,8 +1076,7 @@ bool Darwin::UseSjLjExceptions(const ArgList &Args) const {
 
   // Only watchOS uses the new DWARF/Compact unwinding method.
   llvm::Triple Triple(ComputeLLVMTriple(Args));
-  return !(Triple.getArchName() == "armv7k" ||
-           Triple.getArchName() == "thumbv7k") && !isTargetWatchOS();
+  return !Triple.isWatchABI();
 }
 
 bool MachO::isPICDefault() const { return true; }
index 24a1851..5ebdd38 100644 (file)
@@ -9,3 +9,6 @@
 // match.
 
 // RUN: %clang -target x86_64-apple-macosx10.9 -arch armv7k -miphoneos-version-min=9.0 -c %s -### 2>&1 | FileCheck %s
+
+// RUN: %clang -target x86_64-apple-macosx10.9 -arch armv7 -mwatchos-version-min=9.0 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SJLJ
+// CHECK-SJLJ: "-fsjlj-exceptions"