From 554bcb69c2d785a011a30e7db87a36a87fe7db10 Mon Sep 17 00:00:00 2001
From: dim <dim@FreeBSD.org>
Date: Wed, 15 Aug 2012 20:02:54 +0000
Subject: Vendor import of clang trunk r161861:
 http://llvm.org/svn/llvm-project/cfe/trunk@161861

---
 include/clang/Basic/VersionTuple.h | 45 +++++++++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 15 deletions(-)

(limited to 'include/clang/Basic/VersionTuple.h')

diff --git a/include/clang/Basic/VersionTuple.h b/include/clang/Basic/VersionTuple.h
index 30ef6641..a94f76c 100644
--- a/include/clang/Basic/VersionTuple.h
+++ b/include/clang/Basic/VersionTuple.h
@@ -6,10 +6,11 @@
 // License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
-//
-// This header defines the VersionTuple class, which represents a version in
-// the form major[.minor[.subminor]].
-//
+///
+/// \file
+/// \brief Defines the clang::VersionTuple class, which represents a version in
+/// the form major[.minor[.subminor]].
+///
 //===----------------------------------------------------------------------===//
 #ifndef LLVM_CLANG_BASIC_VERSIONTUPLE_H
 #define LLVM_CLANG_BASIC_VERSIONTUPLE_H
@@ -73,15 +74,18 @@ public:
     return X.Major == Y.Major && X.Minor == Y.Minor && X.Subminor == Y.Subminor;
   }
 
-  /// \brief Determine if two version numbers are not equivalent. If
-  /// not provided, minor and subminor version numbers are considered to be 
+  /// \brief Determine if two version numbers are not equivalent.
+  ///
+  /// If not provided, minor and subminor version numbers are considered to be 
   /// zero.
   friend bool operator!=(const VersionTuple &X, const VersionTuple &Y) {
     return !(X == Y);
   }
 
-  /// \brief Determine whether one version number precedes another. If not
-  /// provided, minor and subminor version numbers are considered to be zero.
+  /// \brief Determine whether one version number precedes another.
+  ///
+  /// If not provided, minor and subminor version numbers are considered to be
+  /// zero.
   friend bool operator<(const VersionTuple &X, const VersionTuple &Y) {
     if (X.Major != Y.Major)
       return X.Major < Y.Major;
@@ -92,28 +96,39 @@ public:
     return X.Subminor < Y.Subminor;
   }
 
-  /// \brief Determine whether one version number follows another. If not
-  /// provided, minor and subminor version numbers are considered to be zero.
+  /// \brief Determine whether one version number follows another.
+  ///
+  /// If not provided, minor and subminor version numbers are considered to be
+  /// zero.
   friend bool operator>(const VersionTuple &X, const VersionTuple &Y) {
     return Y < X;
   }
 
   /// \brief Determine whether one version number precedes or is
-  /// equivalent to another. If not provided, minor and subminor
-  /// version numbers are considered to be zero.
+  /// equivalent to another. 
+  ///
+  /// If not provided, minor and subminor version numbers are considered to be
+  /// zero.
   friend bool operator<=(const VersionTuple &X, const VersionTuple &Y) {
     return !(Y < X);
   }
 
   /// \brief Determine whether one version number follows or is
-  /// equivalent to another. If not provided, minor and subminor
-  /// version numbers are considered to be zero.
+  /// equivalent to another.
+  ///
+  /// If not provided, minor and subminor version numbers are considered to be
+  /// zero.
   friend bool operator>=(const VersionTuple &X, const VersionTuple &Y) {
     return !(X < Y);
   }
 
-  /// \brief Retrieve a string representation of the version number/
+  /// \brief Retrieve a string representation of the version number.
   std::string getAsString() const;
+
+  /// \brief Try to parse the given string as a version number.
+  /// \returns \c true if the string does not match the regular expression
+  ///   [0-9]+(\.[0-9]+(\.[0-9]+))
+  bool tryParse(StringRef string);
 };
 
 /// \brief Print a version number.
-- 
cgit v1.1