1 //===- Version.h - Clang Version Number -------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header defines version macros and version-related utility functions
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_BASIC_VERSION_H
16 #define LLVM_CLANG_BASIC_VERSION_H
18 #include "llvm/ADT/StringRef.h"
20 #include "clang/Basic/Version.inc"
22 /// \brief Helper macro for CLANG_VERSION_STRING.
23 #define CLANG_MAKE_VERSION_STRING2(X) #X
25 #ifdef CLANG_VERSION_PATCHLEVEL
26 /// \brief Helper macro for CLANG_VERSION_STRING.
27 #define CLANG_MAKE_VERSION_STRING(X,Y,Z) CLANG_MAKE_VERSION_STRING2(X.Y.Z)
29 /// \brief A string that describes the Clang version number, e.g.,
31 #define CLANG_VERSION_STRING \
32 CLANG_MAKE_VERSION_STRING(CLANG_VERSION_MAJOR,CLANG_VERSION_MINOR,CLANG_VERSION_PATCHLEVEL)
34 /// \brief Helper macro for CLANG_VERSION_STRING.
35 #define CLANG_MAKE_VERSION_STRING(X,Y) CLANG_MAKE_VERSION_STRING2(X.Y)
37 /// \brief A string that describes the Clang version number, e.g.,
39 #define CLANG_VERSION_STRING \
40 CLANG_MAKE_VERSION_STRING(CLANG_VERSION_MAJOR,CLANG_VERSION_MINOR)
44 /// \brief Retrieves the repository path (e.g., Subversion path) that
45 /// identifies the particular Clang branch, tag, or trunk from which this
47 llvm::StringRef getClangRepositoryPath();
49 /// \brief Retrieves the repository revision number (or identifer) from which
50 /// this Clang was built.
51 std::string getClangRevision();
53 /// \brief Retrieves the full repository version that is an amalgamation of
54 /// the information in getClangRepositoryPath() and getClangRevision().
55 std::string getClangFullRepositoryVersion();
57 /// \brief Retrieves a string representing the complete clang version,
58 /// which includes the clang version number, the repository version,
59 /// and the vendor tag.
60 std::string getClangFullVersion();
63 #endif // LLVM_CLANG_BASIC_VERSION_H