[llvm-commits] [llvm] r129800 - /llvm/trunk/include/llvm/ADT/Triple.h
Daniel Dunbar
daniel at zuster.org
Tue Apr 19 13:30:07 PDT 2011
Author: ddunbar
Date: Tue Apr 19 15:30:07 2011
New Revision: 129800
URL: http://llvm.org/viewvc/llvm-project?rev=129800&view=rev
Log:
ADT/Triple: Add isOSVersionLT helper function.
Modified:
llvm/trunk/include/llvm/ADT/Triple.h
Modified: llvm/trunk/include/llvm/ADT/Triple.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=129800&r1=129799&r2=129800&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h (original)
+++ llvm/trunk/include/llvm/ADT/Triple.h Tue Apr 19 15:30:07 2011
@@ -249,6 +249,20 @@
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
/// @{
More information about the llvm-commits
mailing list