mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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"
|
"-F" "${sdk}/../../../Developer/Library/Frameworks"
|
||||||
"-sdk" "${sdk}"
|
"-sdk" "${sdk}"
|
||||||
"-no-link-objc-runtime")
|
"-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()
|
endif()
|
||||||
|
|
||||||
set(opt_view_main_dir)
|
set(opt_view_main_dir)
|
||||||
if(SWIFT_BENCHMARK_GENERATE_OPT_VIEW AND LLVM_HAVE_OPT_VIEWER_MODULES)
|
if(SWIFT_BENCHMARK_GENERATE_OPT_VIEW AND LLVM_HAVE_OPT_VIEWER_MODULES)
|
||||||
if(NOT ${optflag} STREQUAL "Onone" AND "${bench_flags}" MATCHES "-whole-module.*")
|
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")
|
set(opt_view_main_dir "${objdir}/opt-view")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user