ADT/Triple: Add isOSVersionLT helper function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129800 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2011-04-19 20:30:07 +00:00
parent 087d6a59ad
commit 8974153870

View File

@ -249,6 +249,20 @@ public:
return getOSMajorVersion();
}
bool isOSVersionLT(unsigned Major, unsigned B_Minor, unsigned Micro) {
unsigned LHS[3];
getOSVersion(LHS[0], LHS[1], LHS[2]);
if (LHS[0] != Major)
return LHS[0] < Major;
if (LHS[1] != Minor)
return LHS[1] < Minor;
if (LHS[2] != Micro)
return LHS[1] < Micro;
return false;
}
/// @}
/// @name Mutators
/// @{