2009-06-02 17:58:47 +00:00
|
|
|
//===- Version.h - Clang Version Number -------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2012-04-14 14:01:31 +00:00
|
|
|
// This header defines version macros and version-related utility functions
|
2009-10-14 18:03:49 +00:00
|
|
|
// for Clang.
|
2009-06-02 17:58:47 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CLANG_BASIC_VERSION_H
|
|
|
|
#define LLVM_CLANG_BASIC_VERSION_H
|
|
|
|
|
2010-01-23 11:10:26 +00:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
|
2010-07-13 17:21:42 +00:00
|
|
|
#include "clang/Basic/Version.inc"
|
2009-06-02 17:58:47 +00:00
|
|
|
|
|
|
|
/// \brief Helper macro for CLANG_VERSION_STRING.
|
|
|
|
#define CLANG_MAKE_VERSION_STRING2(X) #X
|
|
|
|
|
2009-10-14 18:03:49 +00:00
|
|
|
#ifdef CLANG_VERSION_PATCHLEVEL
|
|
|
|
/// \brief Helper macro for CLANG_VERSION_STRING.
|
|
|
|
#define CLANG_MAKE_VERSION_STRING(X,Y,Z) CLANG_MAKE_VERSION_STRING2(X.Y.Z)
|
|
|
|
|
|
|
|
/// \brief A string that describes the Clang version number, e.g.,
|
|
|
|
/// "1.0".
|
|
|
|
#define CLANG_VERSION_STRING \
|
2012-04-14 14:01:31 +00:00
|
|
|
CLANG_MAKE_VERSION_STRING(CLANG_VERSION_MAJOR,CLANG_VERSION_MINOR, \
|
|
|
|
CLANG_VERSION_PATCHLEVEL)
|
2009-10-14 18:03:49 +00:00
|
|
|
#else
|
2009-06-02 17:58:47 +00:00
|
|
|
/// \brief Helper macro for CLANG_VERSION_STRING.
|
|
|
|
#define CLANG_MAKE_VERSION_STRING(X,Y) CLANG_MAKE_VERSION_STRING2(X.Y)
|
|
|
|
|
|
|
|
/// \brief A string that describes the Clang version number, e.g.,
|
|
|
|
/// "1.0".
|
|
|
|
#define CLANG_VERSION_STRING \
|
|
|
|
CLANG_MAKE_VERSION_STRING(CLANG_VERSION_MAJOR,CLANG_VERSION_MINOR)
|
2009-10-14 18:03:49 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace clang {
|
2012-04-14 14:01:31 +00:00
|
|
|
/// \brief Retrieves the repository path (e.g., Subversion path) that
|
2010-01-23 11:10:26 +00:00
|
|
|
/// identifies the particular Clang branch, tag, or trunk from which this
|
|
|
|
/// Clang was built.
|
2011-02-20 13:06:31 +00:00
|
|
|
std::string getClangRepositoryPath();
|
2012-04-14 14:01:31 +00:00
|
|
|
|
|
|
|
/// \brief Retrieves the repository path from which LLVM was built. Supports
|
|
|
|
/// LLVM residing in a separate repository from clang.
|
|
|
|
std::string getLLVMRepositoryPath();
|
|
|
|
|
2010-01-23 11:10:26 +00:00
|
|
|
/// \brief Retrieves the repository revision number (or identifer) from which
|
|
|
|
/// this Clang was built.
|
2010-02-16 09:31:36 +00:00
|
|
|
std::string getClangRevision();
|
2012-04-14 14:01:31 +00:00
|
|
|
|
|
|
|
/// \brief Retrieves the repository revision number (or identifer) from which
|
|
|
|
/// LLVM was built. If Clang and LLVM are in the same repository, this returns
|
|
|
|
/// the same string as getClangRevision.
|
|
|
|
std::string getLLVMRevision();
|
|
|
|
|
2010-01-23 11:10:26 +00:00
|
|
|
/// \brief Retrieves the full repository version that is an amalgamation of
|
|
|
|
/// the information in getClangRepositoryPath() and getClangRevision().
|
2010-02-16 09:31:36 +00:00
|
|
|
std::string getClangFullRepositoryVersion();
|
2012-04-14 14:01:31 +00:00
|
|
|
|
2010-01-23 11:10:26 +00:00
|
|
|
/// \brief Retrieves a string representing the complete clang version,
|
2012-04-14 14:01:31 +00:00
|
|
|
/// which includes the clang version number, the repository version,
|
2010-01-23 11:10:26 +00:00
|
|
|
/// and the vendor tag.
|
2010-02-16 09:31:36 +00:00
|
|
|
std::string getClangFullVersion();
|
2011-05-02 19:39:53 +00:00
|
|
|
|
|
|
|
/// \brief Retrieves a string representing the complete clang version suitable
|
|
|
|
/// for use in the CPP __VERSION__ macro, which includes the clang version
|
|
|
|
/// number, the repository version, and the vendor tag.
|
|
|
|
std::string getClangFullCPPVersion();
|
2009-10-14 18:03:49 +00:00
|
|
|
}
|
2009-06-02 17:58:47 +00:00
|
|
|
|
|
|
|
#endif // LLVM_CLANG_BASIC_VERSION_H
|