[PATCH] D38808: [CMake] Improve logic for enabling LTO on LLVM itself

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 12:04:03 PDT 2017


inglorion added inline comments.


================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:781
+
+  # Set to THIN -> error if Windows && !(clang-cl && lld-link), otherwise return THIN
+  if (uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")
----------------
nit: the case here doesn't match what you actually return (THIN vs thin)


================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:838
+
+  append("-flto=${LTO_STYLE}" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
   if(NOT LINKER_IS_LLD_LINK)
----------------
I think the old code supports gcc + gold, which require -flto instead of -flto=full. We still need to translate style full to -flto here, which will do the same thing as -flto=full in clang.


https://reviews.llvm.org/D38808





More information about the llvm-commits mailing list