[PATCH] D31985: Support: Add a VCSRevision.h header file.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 11:11:01 PDT 2017


pcc created this revision.
Herald added a subscriber: mgorny.

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.


https://reviews.llvm.org/D31985

Files:
  llvm/cmake/modules/VersionFromVCS.cmake
  llvm/include/llvm/CMakeLists.txt
  llvm/include/llvm/Support/CMakeLists.txt
  llvm/lib/LTO/CMakeLists.txt
  llvm/lib/LTO/LTO.cpp
  llvm/lib/LTO/LTOCodeGenerator.cpp
  llvm/lib/LTO/ThinLTOCodeGenerator.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31985.95002.patch
Type: text/x-patch
Size: 10728 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170412/a71ac752/attachment.bin>


More information about the llvm-commits mailing list