]> granicus.if.org Git - llvm/commit
Support: Add a VCSRevision.h header file.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 13 Apr 2017 01:26:12 +0000 (01:26 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 13 Apr 2017 01:26:12 +0000 (01:26 +0000)
commit8b69529e74ea79cdf93035e454558866339ef919
tree13faa168c6305142719b8f7d32377065a92c8fef
parentebc666e155b6a86ec2aa78fb180d802c74c893ba
Support: Add a VCSRevision.h header file.

This is a magic header file supported by the build system that provides a
single definition, LLVM_REVISION, containing an LLVM revision identifier,
if available. This functionality previously lived in the LTO library, but
I am moving it out to lib/Support because I want to also start using it in
lib/Object to create the IR symbol table.

This change also fixes a bug where LLVM_REVISION was never actually being
used in lib/LTO because the macro HAS_LLVM_REVISION was never defined (it
was misspelled as HAVE_SVN_VERSION_INC in lib/LTO/CMakeLists.txt, and was
only being defined in a non-existent file Version.cpp).

I also changed the code to use "git rev-parse --git-dir" to locate the .git
directory, instead of looking for it in the LLVM source root directory,
which makes this compatible with monorepos as well as git worktrees.

Differential Revision: https://reviews.llvm.org/D31985

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300160 91177308-0d34-0410-b5e6-96231b3b80d8
cmake/modules/VersionFromVCS.cmake
include/llvm/CMakeLists.txt
include/llvm/Support/CMakeLists.txt [new file with mode: 0644]
lib/LTO/CMakeLists.txt
lib/LTO/LTO.cpp
lib/LTO/ThinLTOCodeGenerator.cpp