1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[Support] Simplify Triple::getOSVersion

Those who are interested in the Android version can use
getEnvironmentVersion instead of getOSVersion.

llvm-svn: 238798
This commit is contained in:
David Majnemer 2015-06-01 23:45:25 +00:00
parent de45e69c9f
commit 878b927ac8

View 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))