clang  14.0.0git
Version.h
Go to the documentation of this file.
1 //===- Version.h - Clang Version Number -------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// 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 "clang/Basic/Version.inc"
19 #include "llvm/ADT/StringRef.h"
20 
21 namespace clang {
22  /// Retrieves the repository path (e.g., Subversion path) that
23  /// identifies the particular Clang branch, tag, or trunk from which this
24  /// Clang was built.
26 
27  /// Retrieves the repository path from which LLVM was built.
28  ///
29  /// This supports LLVM residing in a separate repository from clang.
31 
32  /// Retrieves the repository revision number (or identifier) from which
33  /// this Clang was built.
35 
36  /// Retrieves the repository revision number (or identifier) from which
37  /// LLVM was built.
38  ///
39  /// If Clang and LLVM are in the same repository, this returns the same
40  /// string as getClangRevision.
42 
43  /// Retrieves the full repository version that is an amalgamation of
44  /// the information in getClangRepositoryPath() and getClangRevision().
46 
47  /// Retrieves a string representing the complete clang version,
48  /// which includes the clang version number, the repository version,
49  /// and the vendor tag.
51 
52  /// Like getClangFullVersion(), but with a custom tool name.
53  std::string getClangToolFullVersion(llvm::StringRef ToolName);
54 
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.
59 }
60 
61 #endif // LLVM_CLANG_BASIC_VERSION_H
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::getClangRevision
std::string getClangRevision()
Retrieves the repository revision number (or identifier) from which this Clang was built.
Definition: Version.cpp:44
clang::getClangToolFullVersion
std::string getClangToolFullVersion(llvm::StringRef ToolName)
Like getClangFullVersion(), but with a custom tool name.
clang::getClangFullRepositoryVersion
std::string getClangFullRepositoryVersion()
Retrieves the full repository version that is an amalgamation of the information in getClangRepositor...
Definition: Version.cpp:60
clang::getLLVMRepositoryPath
std::string getLLVMRepositoryPath()
Retrieves the repository path from which LLVM was built.
Definition: Version.cpp:36
clang
Definition: CalledOnceCheck.h:17
clang::getLLVMRevision
std::string getLLVMRevision()
Retrieves the repository revision number (or identifier) from which LLVM was built.
Definition: Version.cpp:52
clang::getClangFullVersion
std::string getClangFullVersion()
Retrieves a string representing the complete clang version, which includes the clang version number,...
Definition: Version.cpp:88
clang::getClangRepositoryPath
std::string getClangRepositoryPath()
Retrieves the repository path (e.g., Subversion path) that identifies the particular Clang branch,...
Definition: Version.cpp:24
clang::getClangFullCPPVersion
std::string getClangFullCPPVersion()
Retrieves a string representing the complete clang version suitable for use in the CPP VERSION macro,...
Definition: Version.cpp:108