llc: Eliminate a use of getDarwinMajorNumber().
authorDaniel Dunbar <daniel@zuster.org>
Tue, 19 Apr 2011 20:46:13 +0000 (20:46 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 19 Apr 2011 20:46:13 +0000 (20:46 +0000)
 - As before, there is a minor semantic change here (evidenced by the test
   change) for Darwin triples that have no version component. I debated changing
   the default behavior of isOSVersionLT, but decided it made more sense for
   triples to be explicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129805 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/X86/2010-05-26-DotDebugLoc.ll
test/CodeGen/X86/dbg-value-range.ll
tools/llc/llc.cpp

index ac26def8ceb066919033d9b127470a39a9734973..6600cc3cae4f642cacb4bfdabe9424aec371b11b 100644 (file)
@@ -1,7 +1,7 @@
 ; RUN: llc -O2 < %s | FileCheck %s
 ; RUN: llc -O2 -regalloc=basic < %s | FileCheck %s
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
-target triple = "x86_64-apple-darwin"
+target triple = "x86_64-apple-darwin10"
 
 %struct.a = type { i32, %struct.a* }
 
index 67e3eee0bdd74ec63e9ff6d4d9405bc21acfd027..da49f2dee1a772288ce75b0a3451c306a0da4816 100644 (file)
@@ -1,5 +1,5 @@
-; RUN: llc -mtriple=x86_64-apple-darwin < %s | FileCheck %s
-; RUN: llc -mtriple=x86_64-apple-darwin -regalloc=basic < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-apple-darwin10 < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-apple-darwin10 -regalloc=basic < %s | FileCheck %s
 
 %struct.a = type { i32 }
 
index 7f5fa3ffe8d82215e0816b65b3283e36210a5b9d..99d43c8daf4cd231583bffd7a93627c0218b2f55 100644 (file)
@@ -278,18 +278,10 @@ int main(int argc, char **argv) {
 
   if (DisableDotLoc)
     Target.setMCUseLoc(false);
-  if (TheTriple.getOS() == Triple::Darwin) {
-    switch (TheTriple.getDarwinMajorNumber()) {
-    case 7:
-    case 8:
-    case 9:
-      // disable .loc support for older darwin OS.
-      Target.setMCUseLoc(false);
-      break;
-    default:
-      break;
-    }
-  }
+
+  // Disable .loc support for older OS X versions.
+  if (TheTriple.isOSX() && TheTriple.isOSXVersionLT(10, 5))
+    Target.setMCUseLoc(false);
 
   // Figure out where we are going to send the output...
   OwningPtr<tool_output_file> Out