[PATCH] D30904: Allow suppressing host and target info in VersionPrinter
Xin Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 18 17:16:24 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL300630: Allow suppressing host and target info in VersionPrinter (authored by trentxintong).
Changed prior to commit:
https://reviews.llvm.org/D30904?vs=92729&id=95660#toc
Repository:
rL LLVM
https://reviews.llvm.org/D30904
Files:
llvm/trunk/CMakeLists.txt
llvm/trunk/include/llvm/Config/config.h.cmake
llvm/trunk/lib/Support/CommandLine.cpp
Index: llvm/trunk/include/llvm/Config/config.h.cmake
===================================================================
--- llvm/trunk/include/llvm/Config/config.h.cmake
+++ llvm/trunk/include/llvm/Config/config.h.cmake
@@ -386,6 +386,9 @@
/* 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
+
/* Major version of the LLVM API */
#define LLVM_VERSION_MAJOR ${LLVM_VERSION_MAJOR}
Index: llvm/trunk/CMakeLists.txt
===================================================================
--- llvm/trunk/CMakeLists.txt
+++ llvm/trunk/CMakeLists.txt
@@ -512,6 +512,9 @@
option (LLVM_BUILD_EXTERNAL_COMPILER_RT
"Build compiler-rt as an external project." OFF)
+option (LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO
+ "Show target and host info when tools are invoked with --version." ON)
+
# You can configure which libraries from LLVM you want to include in the
# shared library by setting LLVM_DYLIB_COMPONENTS to a semi-colon delimited
# list of LLVM components. All component names handled by llvm-config are valid.
Index: llvm/trunk/lib/Support/CommandLine.cpp
===================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp
+++ llvm/trunk/lib/Support/CommandLine.cpp
@@ -2069,12 +2069,15 @@
#ifndef NDEBUG
OS << " with assertions";
#endif
+#if LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO
std::string CPU = sys::getHostCPUName();
if (CPU == "generic")
CPU = "(unknown)";
OS << ".\n"
<< " Default target: " << sys::getDefaultTargetTriple() << '\n'
- << " Host CPU: " << CPU << '\n';
+ << " Host CPU: " << CPU;
+#endif
+ OS << '\n';
}
void operator=(bool OptionWasSpecified) {
if (!OptionWasSpecified)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30904.95660.patch
Type: text/x-patch
Size: 1889 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170419/b631c102/attachment.bin>
More information about the llvm-commits
mailing list