Skip to content

Commit

Permalink
[config] Remove vestigial LLVM_VERSION_INFO
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rnk committed Jun 7, 2022
1 parent b1c7889 commit 570e76b
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 28 deletions.
3 changes: 0 additions & 3 deletions llvm/include/llvm/Config/config.h.cmake
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions llvm/lib/LTO/LTOCodeGenerator.cpp
Expand Up @@ -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 {
Expand Down
6 changes: 1 addition & 5 deletions llvm/lib/Support/CommandLine.cpp
Expand Up @@ -2468,11 +2468,7 @@ class VersionPrinter {
#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
Expand Down
1 change: 0 additions & 1 deletion llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
Expand Up @@ -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/",
Expand Down
9 changes: 0 additions & 9 deletions utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
Expand Up @@ -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",
Expand All @@ -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",
],
Expand Down
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions utils/bazel/llvm_configs/config.h.cmake
Expand Up @@ -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

Expand Down

0 comments on commit 570e76b

Please sign in to comment.