Target/X86: Eliminate uses of getDarwinVers().
authorDaniel Dunbar <daniel@zuster.org>
Tue, 19 Apr 2011 21:04:12 +0000 (21:04 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 19 Apr 2011 21:04:12 +0000 (21:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129813 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86FastISel.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86Subtarget.cpp
lib/Target/X86/X86Subtarget.h

index 33e7ea5f80e407760eb7f47452953cc9451d1ccc..a2e328dad740f90919d2139b12adc0534962fb69 100644 (file)
@@ -1773,7 +1773,8 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
       OpFlags = X86II::MO_PLT;
     } else if (Subtarget->isPICStyleStubAny() &&
                (GV->isDeclaration() || GV->isWeakForLinker()) &&
-               Subtarget->getDarwinVers() < 9) {
+               (!Subtarget->getTargetTriple().isOSX() ||
+                Subtarget->getTargetTriple().isOSXVersionLT(10, 5))) {
       // PC-relative references to external symbols should go through $stub,
       // unless we're building with the leopard linker or later, which
       // automatically synthesizes these stubs.
index 449b87a55b596437adf4aa14a4205fa6c9e99164..ad858b57bab29d0e61b9a7358b1c91ac36d5d991 100644 (file)
@@ -2281,7 +2281,8 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
         OpFlags = X86II::MO_PLT;
       } else if (Subtarget->isPICStyleStubAny() &&
                  (GV->isDeclaration() || GV->isWeakForLinker()) &&
-                 Subtarget->getDarwinVers() < 9) {
+                 (!Subtarget->getTargetTriple().isOSX() ||
+                  Subtarget->getTargetTriple().isOSXVersionLT(10, 5))) {
         // PC-relative references to external symbols should go through $stub,
         // unless we're building with the leopard linker or later, which
         // automatically synthesizes these stubs.
@@ -2300,7 +2301,8 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
         getTargetMachine().getRelocationModel() == Reloc::PIC_) {
       OpFlags = X86II::MO_PLT;
     } else if (Subtarget->isPICStyleStubAny() &&
-               Subtarget->getDarwinVers() < 9) {
+               (!Subtarget->getTargetTriple().isOSX() ||
+                Subtarget->getTargetTriple().isOSXVersionLT(10, 5))) {
       // PC-relative references to external symbols should go through $stub,
       // unless we're building with the leopard linker or later, which
       // automatically synthesizes these stubs.
index 1ee73123bbc619d4fc8c629f10482e83a9d4b9ed..b02602e88f8cc95f1f3291b576dcce17ea55b3b7 100644 (file)
@@ -144,7 +144,7 @@ ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const {
 /// passed as the second argument. Otherwise it returns null.
 const char *X86Subtarget::getBZeroEntry() const {
   // Darwin 10 has a __bzero entry point for this purpose.
-  if (getDarwinVers() >= 10)
+  if (getTargetTriple().isOSX() && !getTargetTriple().isOSXVersionLT(10, 6))
     return "__bzero";
 
   return 0;
index 02194ae22f1cdc6ff91d6bcad099d228ca64d3e6..7dcfe546a58ff69d80ea71baef08188482301b8d 100644 (file)
@@ -217,13 +217,6 @@ public:
     return PICStyle == PICStyles::StubDynamicNoPIC ||
            PICStyle == PICStyles::StubPIC; }
 
-  /// getDarwinVers - Return the darwin version number, 8 = Tiger, 9 = Leopard,
-  /// 10 = Snow Leopard, etc.
-  unsigned getDarwinVers() const {
-    if (isTargetDarwin()) return TargetTriple.getDarwinMajorNumber();
-    return 0;
-  }
-
   /// ClassifyGlobalReference - Classify a global variable reference for the
   /// current subtarget according to how we should reference it in a non-pcrel
   /// context.