diff options
author | Amir Ayupov <aaupov@fb.com> | 2022-04-15 05:09:44 +0300 |
---|---|---|
committer | Amir Ayupov <aaupov@fb.com> | 2022-04-15 05:16:35 +0300 |
commit | 2a9386726b3e28a45c8bef2f640970e688875572 (patch) | |
tree | 1a944b533108ec2bbdcdd84f2072fd8e698138e8 /bolt | |
parent | 3d79c52f31041e0a11ea48814c0d009518063a3d (diff) |
[BOLT][NFC] Use LLVM_REVISION instead of BOLT_VERSION_STRING
Remove duplicate version string identification
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D123549
Diffstat (limited to 'bolt')
-rw-r--r-- | bolt/CMakeLists.txt | 23 | ||||
-rw-r--r-- | bolt/include/bolt/Utils/BoltRevision.inc.in | 1 | ||||
-rw-r--r-- | bolt/lib/Utils/CommandLineOpts.cpp | 4 |
3 files changed, 2 insertions, 26 deletions
diff --git a/bolt/CMakeLists.txt b/bolt/CMakeLists.txt index bf2e04779513..cb4676f49bb4 100644 --- a/bolt/CMakeLists.txt +++ b/bolt/CMakeLists.txt @@ -59,31 +59,8 @@ if (BOLT_ENABLE_RUNTIME) COMPONENT bolt) endif() -# Get the current git revision for BOLT. -find_program(git_executable NAMES git git.exe git.cmd) -if (git_executable) - execute_process(COMMAND ${git_executable} rev-parse HEAD - WORKING_DIRECTORY ${LLVM_MAIN_SRC_DIR} - TIMEOUT 5 - RESULT_VARIABLE git_result - OUTPUT_VARIABLE git_output) - if( git_result EQUAL 0 ) - string(STRIP "${git_output}" git_ref_id) - set(BOLT_REVISION "${git_ref_id}") - endif() -endif() - find_program(GNU_LD_EXECUTABLE NAMES ${LLVM_DEFAULT_TARGET_TRIPLE}-ld.bfd ld.bfd DOC "GNU ld") -# If we can't find a revision, set it to "<unknown>". -if (NOT BOLT_REVISION) - set(BOLT_REVISION "<unknown>") -endif() - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/include/bolt/Utils/BoltRevision.inc.in - ${CMAKE_CURRENT_BINARY_DIR}/include/bolt/Utils/BoltRevision.inc) - include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include diff --git a/bolt/include/bolt/Utils/BoltRevision.inc.in b/bolt/include/bolt/Utils/BoltRevision.inc.in deleted file mode 100644 index 23bb20bc593f..000000000000 --- a/bolt/include/bolt/Utils/BoltRevision.inc.in +++ /dev/null @@ -1 +0,0 @@ -#define BOLT_VERSION_STRING "@BOLT_REVISION@" diff --git a/bolt/lib/Utils/CommandLineOpts.cpp b/bolt/lib/Utils/CommandLineOpts.cpp index 9ea20ac0c354..6aa1b777e4a7 100644 --- a/bolt/lib/Utils/CommandLineOpts.cpp +++ b/bolt/lib/Utils/CommandLineOpts.cpp @@ -11,13 +11,13 @@ //===----------------------------------------------------------------------===// #include "bolt/Utils/CommandLineOpts.h" -#include "bolt/Utils/BoltRevision.inc" +#include "llvm/Support/VCSRevision.h" using namespace llvm; namespace llvm { namespace bolt { -const char *BoltRevision = BOLT_VERSION_STRING; +const char *BoltRevision = LLVM_REVISION; } } |