]> granicus.if.org Git - clang/commitdiff
Now the proper fix for r156497. Sorry for the churn.
authorChad Rosier <mcrosier@apple.com>
Wed, 9 May 2012 18:46:30 +0000 (18:46 +0000)
committerChad Rosier <mcrosier@apple.com>
Wed, 9 May 2012 18:46:30 +0000 (18:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156498 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index 2e2ec938f51794b04c5f15a4749d2274d19f4148..12f292d55434d953ab5b294445592d0ad743c729 100644 (file)
@@ -59,6 +59,11 @@ Darwin::Darwin(const Driver &D, const llvm::Triple& Triple)
   DarwinVersion[0] = Minor + 4;
   DarwinVersion[1] = Micro;
   DarwinVersion[2] = 0;
+
+  // Compute the initial iOS version from the triple
+  getTriple().getiOSVersion(Major, Minor, Micro);
+  llvm::raw_string_ostream(iOSVersionMin)
+    << Major << '.' << Minor << '.' << Micro;
 }
 
 types::ID Darwin::LookupTypeForExtension(const char *Ext) const {
@@ -525,10 +530,6 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const {
     // go ahead as assume we're targeting iOS.
     if (OSXTarget.empty() && iOSTarget.empty())
       if (getDarwinArchName(Args) == "armv7") {
-        unsigned Major, Minor, Micro;
-        getTriple().getiOSVersion(Major, Minor, Micro);
-        llvm::raw_string_ostream(iOSVersionMin)
-          << Major << '.' << Minor << '.' << Micro;
         iOSTarget = iOSVersionMin;
       }