10b57cec5SDimitry Andric //===- Version.h - Clang Version Number -------------------------*- C++ -*-===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric /// 90b57cec5SDimitry Andric /// \file 100b57cec5SDimitry Andric /// Defines version macros and version-related utility functions 110b57cec5SDimitry Andric /// for Clang. 120b57cec5SDimitry Andric /// 130b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 140b57cec5SDimitry Andric 150b57cec5SDimitry Andric #ifndef LLVM_CLANG_BASIC_VERSION_H 160b57cec5SDimitry Andric #define LLVM_CLANG_BASIC_VERSION_H 170b57cec5SDimitry Andric 180b57cec5SDimitry Andric #include "clang/Basic/Version.inc" 190b57cec5SDimitry Andric #include "llvm/ADT/StringRef.h" 200b57cec5SDimitry Andric 210b57cec5SDimitry Andric namespace clang { 220b57cec5SDimitry Andric /// Retrieves the repository path (e.g., Subversion path) that 230b57cec5SDimitry Andric /// identifies the particular Clang branch, tag, or trunk from which this 240b57cec5SDimitry Andric /// Clang was built. 250b57cec5SDimitry Andric std::string getClangRepositoryPath(); 260b57cec5SDimitry Andric 270b57cec5SDimitry Andric /// Retrieves the repository path from which LLVM was built. 280b57cec5SDimitry Andric /// 290b57cec5SDimitry Andric /// This supports LLVM residing in a separate repository from clang. 300b57cec5SDimitry Andric std::string getLLVMRepositoryPath(); 310b57cec5SDimitry Andric 320b57cec5SDimitry Andric /// Retrieves the repository revision number (or identifier) from which 330b57cec5SDimitry Andric /// this Clang was built. 340b57cec5SDimitry Andric std::string getClangRevision(); 350b57cec5SDimitry Andric 360b57cec5SDimitry Andric /// Retrieves the repository revision number (or identifier) from which 370b57cec5SDimitry Andric /// LLVM was built. 380b57cec5SDimitry Andric /// 390b57cec5SDimitry Andric /// If Clang and LLVM are in the same repository, this returns the same 400b57cec5SDimitry Andric /// string as getClangRevision. 410b57cec5SDimitry Andric std::string getLLVMRevision(); 420b57cec5SDimitry Andric 43*cb14a3feSDimitry Andric /// Retrieves the Clang vendor tag. 44*cb14a3feSDimitry Andric std::string getClangVendor(); 45*cb14a3feSDimitry Andric 460b57cec5SDimitry Andric /// Retrieves the full repository version that is an amalgamation of 470b57cec5SDimitry Andric /// the information in getClangRepositoryPath() and getClangRevision(). 480b57cec5SDimitry Andric std::string getClangFullRepositoryVersion(); 490b57cec5SDimitry Andric 500b57cec5SDimitry Andric /// Retrieves a string representing the complete clang version, 510b57cec5SDimitry Andric /// which includes the clang version number, the repository version, 520b57cec5SDimitry Andric /// and the vendor tag. 530b57cec5SDimitry Andric std::string getClangFullVersion(); 540b57cec5SDimitry Andric 550b57cec5SDimitry Andric /// Like getClangFullVersion(), but with a custom tool name. 560b57cec5SDimitry Andric std::string getClangToolFullVersion(llvm::StringRef ToolName); 570b57cec5SDimitry Andric 580b57cec5SDimitry Andric /// Retrieves a string representing the complete clang version suitable 590b57cec5SDimitry Andric /// for use in the CPP __VERSION__ macro, which includes the clang version 600b57cec5SDimitry Andric /// number, the repository version, and the vendor tag. 610b57cec5SDimitry Andric std::string getClangFullCPPVersion(); 620b57cec5SDimitry Andric } 630b57cec5SDimitry Andric 640b57cec5SDimitry Andric #endif // LLVM_CLANG_BASIC_VERSION_H 65