]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/clang/Basic/Version.h
Update clang to r103004.
[FreeBSD/FreeBSD.git] / include / clang / Basic / Version.h
1 //===- Version.h - Clang Version Number -------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This header defines version macros and version-related utility functions 
11 // for Clang.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CLANG_BASIC_VERSION_H
16 #define LLVM_CLANG_BASIC_VERSION_H
17
18 #include "llvm/ADT/StringRef.h"
19
20 /// \brief Clang major version
21 #define CLANG_VERSION_MAJOR 2
22
23 // FIXME: Updates to this file must also update CMakeLists.txt and VER.
24 /// \brief Clang minor version
25 #define CLANG_VERSION_MINOR 0
26
27 /// \brief Clang patchlevel version
28 // #define CLANG_VERSION_PATCHLEVEL 1
29
30 /// \brief Helper macro for CLANG_VERSION_STRING.
31 #define CLANG_MAKE_VERSION_STRING2(X) #X
32
33 #ifdef CLANG_VERSION_PATCHLEVEL
34 /// \brief Helper macro for CLANG_VERSION_STRING.
35 #define CLANG_MAKE_VERSION_STRING(X,Y,Z) CLANG_MAKE_VERSION_STRING2(X.Y.Z)
36
37 /// \brief A string that describes the Clang version number, e.g.,
38 /// "1.0".
39 #define CLANG_VERSION_STRING \
40   CLANG_MAKE_VERSION_STRING(CLANG_VERSION_MAJOR,CLANG_VERSION_MINOR,CLANG_VERSION_PATCHLEVEL)
41 #else
42 /// \brief Helper macro for CLANG_VERSION_STRING.
43 #define CLANG_MAKE_VERSION_STRING(X,Y) CLANG_MAKE_VERSION_STRING2(X.Y)
44
45 /// \brief A string that describes the Clang version number, e.g.,
46 /// "1.0".
47 #define CLANG_VERSION_STRING \
48   CLANG_MAKE_VERSION_STRING(CLANG_VERSION_MAJOR,CLANG_VERSION_MINOR)
49 #endif
50
51 namespace clang {
52   /// \brief Retrieves the repository path (e.g., Subversion path) that 
53   /// identifies the particular Clang branch, tag, or trunk from which this
54   /// Clang was built.
55   llvm::StringRef getClangRepositoryPath();
56   
57   /// \brief Retrieves the repository revision number (or identifer) from which
58   ///  this Clang was built.
59   std::string getClangRevision();
60   
61   /// \brief Retrieves the full repository version that is an amalgamation of
62   ///  the information in getClangRepositoryPath() and getClangRevision().
63   std::string getClangFullRepositoryVersion();
64   
65   /// \brief Retrieves a string representing the complete clang version,
66   ///   which includes the clang version number, the repository version, 
67   ///   and the vendor tag.
68   std::string getClangFullVersion();
69 }
70
71 #endif // LLVM_CLANG_BASIC_VERSION_H