mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[opt-remark] Add support for emitting opt-remark bitstream artifacts when building benchmarks with cmake.
I didn't do this for swiftpm as well since when I tried passing this via unsafeFlags to swiftpm, swiftpm just created the opt-remarks in my source directory instead of next to the .o in the build directory. A problem for another time.
This commit is contained in:
@@ -367,12 +367,17 @@ function (swift_benchmark_compile_archopts)
|
||||
"-F" "${sdk}/../../../Developer/Library/Frameworks"
|
||||
"-sdk" "${sdk}"
|
||||
"-no-link-objc-runtime")
|
||||
|
||||
# If we are not compiling at -Onone and are performing WMO, always emit
|
||||
# optimization-records.
|
||||
if(NOT ${optflag} STREQUAL "Onone" AND "${bench_flags}" MATCHES "-whole-module.*")
|
||||
list(APPEND common_options "-save-optimization-record=bitstream")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(opt_view_main_dir)
|
||||
if(SWIFT_BENCHMARK_GENERATE_OPT_VIEW AND LLVM_HAVE_OPT_VIEWER_MODULES)
|
||||
if(NOT ${optflag} STREQUAL "Onone" AND "${bench_flags}" MATCHES "-whole-module.*")
|
||||
list(APPEND common_options "-save-optimization-record")
|
||||
set(opt_view_main_dir "${objdir}/opt-view")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user