From fbc33b20c869ece56ee6b7a985e846b61a02a14b Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 30 Nov 2018 19:52:57 +0700 Subject: [PATCH] cmake: Allow saving clang's optimization records. This gives some insight into what the compiler has decided to do or not do. --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc5eecdef..34d2c689d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -425,6 +425,15 @@ list(APPEND Z3_DEPENDENT_LIBS ${CMAKE_THREAD_LIBS_INIT}) ################################################################################ include(${CMAKE_SOURCE_DIR}/cmake/compiler_warnings.cmake) +################################################################################ +# Save Clang optimization records +################################################################################ +option(SAVE_CLANG_OPTIMIZATION_RECORDS "Enable saving Clang optimization records." OFF) + +if (SAVE_CLANG_OPTIMIZATION_RECORDS) + z3_add_cxx_flag("-fsave-optimization-record" REQUIRED) +endif() + ################################################################################ # If using Ninja, force color output for Clang (and gcc, disabled to check build). ################################################################################