[PATCH] D61243: Check build-type dependent variables for -flto as well.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 28 11:56:14 PDT 2019
fhahn created this revision.
fhahn added reviewers: lebedev.ri, MatzeB, cmatthews.
Herald added subscribers: dexonsmith, inglorion, mehdi_amini, mgorny.
Herald added a project: LLVM.
Currently we do not collect stats during the link step, if -flto is
added to the build-type dependent CMAKE_C/CXX_FLAGS variables. We should
check those variables as well.
Repository:
rT test-suite
https://reviews.llvm.org/D61243
Files:
CMakeLists.txt
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -234,13 +234,14 @@
option(TEST_SUITE_BENCHMARKING_ONLY "Only run the benchmarking only subset" OFF)
option(TEST_SUITE_COLLECT_STATS "Collect LLVM statistics" OFF)
+string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
if(TEST_SUITE_COLLECT_STATS)
list(APPEND CFLAGS -save-stats=obj)
list(APPEND CXXFLAGS -save-stats=obj)
# Collect stats for LTO step too.
- if (${CMAKE_C_FLAGS} MATCHES ".*-flto.*" AND
- ${CMAKE_CXX_FLAGS} MATCHES ".*-flto.*")
- list(APPEND LDFLAGS -save-stats=obj)
+ if ("${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}" MATCHES ".*-flto.*" AND
+ "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}" MATCHES ".*-flto.*")
+ list(APPEND LDFLAGS -save-stats=obj)
endif()
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61243.197035.patch
Type: text/x-patch
Size: 895 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190428/ba7671a1/attachment.bin>
More information about the llvm-commits
mailing list