]> granicus.if.org Git - clang/commitdiff
Refactor r135502 to avoid an empty if else condition, per Eric's suggestion (good...
authorChad Rosier <mcrosier@apple.com>
Tue, 19 Jul 2011 20:00:06 +0000 (20:00 +0000)
committerChad Rosier <mcrosier@apple.com>
Tue, 19 Jul 2011 20:00:06 +0000 (20:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135510 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp

index 2a68d68ee67acc384897ce7ae34dec83f4318cdc..1b17e2e9ed4d120310e84dbd96b2c164db5cc8a9 100644 (file)
@@ -146,6 +146,14 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
     }
   }
 
+  // If -ccc-host-triple arch-pc-win32-macho option specified, we're
+  // generating code for Win32 ABI. No need to emit 
+  // __ENVIRONMENT_XX_OS_VERSION_MIN_REQUIRED__.
+  if (PlatformName == "win32") {
+    PlatformMinVersion = VersionTuple(Maj, Min, Rev);
+    return;
+  }
+
   // Set the appropriate OS version define.
   if (PlatformName == "ios") {
     assert(Maj < 10 && Min < 100 && Rev < 100 && "Invalid version!");
@@ -157,10 +165,6 @@ static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
     Str[4] = '0' + (Rev % 10);
     Str[5] = '\0';
     Builder.defineMacro("__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__", Str);
-  } else if (PlatformName == "win32") {
-    // Due to option -ccc-host-triple arch-pc-win32-macho.
-    // Don't emit __ENVIRONMENT_XX_OS_VERSION_MIN_REQUIRED__ as we're generating
-    // code for Win32 ABI.
   } else {
     // Note that the Driver allows versions which aren't representable in the
     // define (because we only get a single digit for the minor and micro