[config] Remove vestigial LLVM_VERSION_INFO

This has been superseded by the llvm/Support/VCSRevision.h header. So
far as I can tell, nothing in the CMake build sets LLVM_VERSION_INFO. It
was always undefined, and the ifdefs using it were dead. However, CMake
is very flexible, so it's possible that I missed some ways to set this
variable. One could, for example, probably pass -DLLVM_VERSION_INFO=x on
the command line and get that through to configure_file, or set the
variable in an obscure way (`set(${proj}_VERSION_INFO "x")`). I'm
reasonably confident that isn't happening, but I'd like a second
opinion.

Update the Bazel and gn builds accordingly.

Differential Revision: https://reviews.llvm.org/D126977
This commit is contained in:
Reid Kleckner 2022-06-03 10:27:02 -07:00
parent b1c7889f32
commit 570e76bb6c
7 changed files with 1 additions and 28 deletions

View file

@ -293,9 +293,6 @@
/* Define if overriding target triple is enabled */
#cmakedefine LLVM_TARGET_TRIPLE_ENV "${LLVM_TARGET_TRIPLE_ENV}"
/* LLVM version information */
#cmakedefine LLVM_VERSION_INFO "${LLVM_VERSION_INFO}"
/* Whether tools show host and target info when invoked with --version */
#cmakedefine01 LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO

View file

@ -66,11 +66,7 @@
using namespace llvm;
const char* LTOCodeGenerator::getVersionString() {
#ifdef LLVM_VERSION_INFO
return PACKAGE_NAME " version " PACKAGE_VERSION ", " LLVM_VERSION_INFO;
#else
return PACKAGE_NAME " version " PACKAGE_VERSION;
#endif
}
namespace llvm {

View file

@ -2468,11 +2468,7 @@ public:
#else
OS << "LLVM (http://llvm.org/):\n ";
#endif
OS << PACKAGE_NAME << " version " << PACKAGE_VERSION;
#ifdef LLVM_VERSION_INFO
OS << " " << LLVM_VERSION_INFO;
#endif
OS << "\n ";
OS << PACKAGE_NAME << " version " << PACKAGE_VERSION << "\n ";
#if LLVM_IS_DEBUG_BUILD
OS << "DEBUG build";
#else

View file

@ -121,7 +121,6 @@ write_cmake_config("config") {
"HOST_LINK_VERSION=",
"LIBPFM_HAS_FIELD_CYCLES=",
"LLVM_TARGET_TRIPLE_ENV=",
"LLVM_VERSION_INFO=",
"LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO=1",
"LLVM_WINDOWS_PREFER_FORWARD_SLASH=",
"PACKAGE_BUGREPORT=https://github.com/llvm/llvm-project/issues/",

View file

@ -93,14 +93,6 @@ enum_targets_gen(
targets = llvm_target_mcas,
)
# TODO: Need to replace this with something that actually extracts the git
# commit from the LLVM source (submodule or http_archive).
genrule(
name = "version_info_gen",
outs = ["include/llvm/Config/VersionInfo.h"],
cmd = "echo '#define LLVM_VERSION_INFO \"git\"' > $@",
)
template_rule(
name = "abi_breaking_h_gen",
src = "include/llvm/Config/abi-breaking.h.cmake",
@ -124,7 +116,6 @@ exports_files([
cc_library(
name = "config",
hdrs = [
"include/llvm/Config/VersionInfo.h",
"include/llvm/Config/abi-breaking.h",
"include/llvm/Config/llvm-config.h",
],

View file

@ -309,9 +309,6 @@
/* Define if overriding target triple is enabled */
/* #undef LLVM_TARGET_TRIPLE_ENV */
/* LLVM version information */
/* #undef LLVM_VERSION_INFO */
/* Whether tools show host and target info when invoked with --version */
#define LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO 1

View file

@ -293,9 +293,6 @@
/* Define if overriding target triple is enabled */
#cmakedefine LLVM_TARGET_TRIPLE_ENV "${LLVM_TARGET_TRIPLE_ENV}"
/* LLVM version information */
#cmakedefine LLVM_VERSION_INFO "${LLVM_VERSION_INFO}"
/* Whether tools show host and target info when invoked with --version */
#cmakedefine01 LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO