1 //===- Version.h - Clang Version Number -------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 /// 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 "clang/Basic/Version.inc"
19 #include "llvm/ADT/StringRef.h"
22 /// Retrieves the repository path (e.g., Subversion path) that
23 /// identifies the particular Clang branch, tag, or trunk from which this
25 std::string getClangRepositoryPath();
27 /// Retrieves the repository path from which LLVM was built.
29 /// This supports LLVM residing in a separate repository from clang.
30 std::string getLLVMRepositoryPath();
32 /// Retrieves the repository revision number (or identifier) from which
33 /// this Clang was built.
34 std::string getClangRevision();
36 /// Retrieves the repository revision number (or identifier) from which
39 /// If Clang and LLVM are in the same repository, this returns the same
40 /// string as getClangRevision.
41 std::string getLLVMRevision();
43 /// Retrieves the full repository version that is an amalgamation of
44 /// the information in getClangRepositoryPath() and getClangRevision().
45 std::string getClangFullRepositoryVersion();
47 /// Retrieves a string representing the complete clang version,
48 /// which includes the clang version number, the repository version,
49 /// and the vendor tag.
50 std::string getClangFullVersion();
52 /// Like getClangFullVersion(), but with a custom tool name.
53 std::string getClangToolFullVersion(llvm::StringRef ToolName);
55 /// Retrieves a string representing the complete clang version suitable
56 /// for use in the CPP __VERSION__ macro, which includes the clang version
57 /// number, the repository version, and the vendor tag.
58 std::string getClangFullCPPVersion();
61 #endif // LLVM_CLANG_BASIC_VERSION_H