[Support] Simplify Triple::getOSVersion
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 1 Jun 2015 23:45:25 +0000 (23:45 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 1 Jun 2015 23:45:25 +0000 (23:45 +0000)
Those who are interested in the Android version can use
getEnvironmentVersion instead of getOSVersion.

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

lib/Support/Triple.cpp

index 6c6b87ea5fb91eb1babbb483b42bcb4b58ca8038..4bfcd76ab8775fa04496020c853e437568231e5e 100644 (file)
@@ -815,21 +815,13 @@ void Triple::getEnvironmentVersion(unsigned &Major, unsigned &Minor,
   StringRef EnvironmentTypeName = getEnvironmentTypeName(getEnvironment());
   if (EnvironmentName.startswith(EnvironmentTypeName))
     EnvironmentName = EnvironmentName.substr(EnvironmentTypeName.size());
+
   parseVersionFromName(EnvironmentName, Major, Minor, Micro);
 }
 
 void Triple::getOSVersion(unsigned &Major, unsigned &Minor,
                           unsigned &Micro) const {
   StringRef OSName = getOSName();
-
-  // For Android, we care about the Android version rather than the Linux
-  // version.
-  if (getEnvironment() == Android) {
-    OSName = getEnvironmentName().substr(strlen("android"));
-    if (OSName.startswith("eabi"))
-      OSName = OSName.substr(strlen("eabi"));
-  }
-
   // Assume that the OS portion of the triple starts with the canonical name.
   StringRef OSTypeName = getOSTypeName(getOS());
   if (OSName.startswith(OSTypeName))