[PATCH] D123549: [BOLT][NFC] Use LLVM_REVISION instead of BOLT_VERSION_STRING
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 11 15:36:08 PDT 2022
Amir created this revision.
Herald added subscribers: ayermolo, mgorny.
Herald added a reviewer: rafauler.
Herald added a reviewer: maksfb.
Herald added a project: All.
Amir requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.
Remove duplicate version string identification
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D123549
Files:
bolt/CMakeLists.txt
bolt/include/bolt/Utils/BoltRevision.inc.in
bolt/lib/Utils/CommandLineOpts.cpp
Index: bolt/lib/Utils/CommandLineOpts.cpp
===================================================================
--- bolt/lib/Utils/CommandLineOpts.cpp
+++ 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;
}
}
Index: bolt/include/bolt/Utils/BoltRevision.inc.in
===================================================================
--- bolt/include/bolt/Utils/BoltRevision.inc.in
+++ /dev/null
@@ -1 +0,0 @@
-#define BOLT_VERSION_STRING "@BOLT_REVISION@"
Index: bolt/CMakeLists.txt
===================================================================
--- bolt/CMakeLists.txt
+++ bolt/CMakeLists.txt
@@ -59,31 +59,8 @@
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123549.422057.patch
Type: text/x-patch
Size: 1929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220411/ca2a7967/attachment.bin>
More information about the llvm-commits
mailing list