Index: include/llvm/Config/config.h.cmake =================================================================== --- include/llvm/Config/config.h.cmake +++ include/llvm/Config/config.h.cmake @@ -435,4 +435,8 @@ /* Define to a function implementing strdup */ #cmakedefine strdup ${strdup} +/* Define to 1 to disable printing target and host info in the VersionPrinter, + which can reduce your binary size. */ +#cmakedefine LLVM_VERSION_PRINTER_NO_HOST_TARGET_INFO ${LLVM_VERSION_PRINTER_NO_HOST_TARGET_INFO} + #endif Index: lib/Support/CommandLine.cpp =================================================================== --- lib/Support/CommandLine.cpp +++ lib/Support/CommandLine.cpp @@ -2072,12 +2072,15 @@ #ifndef NDEBUG OS << " with assertions"; #endif +#ifndef LLVM_VERSION_PRINTER_NO_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)