File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -367,12 +367,17 @@ function (swift_benchmark_compile_archopts)
367
367
"-F" "${sdk} /../../../Developer/Library/Frameworks"
368
368
"-sdk" "${sdk} "
369
369
"-no-link-objc-runtime" )
370
+
371
+ # If we are not compiling at -Onone and are performing WMO, always emit
372
+ # optimization-records.
373
+ if (NOT ${optflag} STREQUAL "Onone" AND "${bench_flags} " MATCHES "-whole-module.*" )
374
+ list (APPEND common_options "-save-optimization-record=bitstream" )
375
+ endif ()
370
376
endif ()
371
377
372
378
set (opt_view_main_dir )
373
379
if (SWIFT_BENCHMARK_GENERATE_OPT_VIEW AND LLVM_HAVE_OPT_VIEWER_MODULES )
374
380
if (NOT ${optflag} STREQUAL "Onone" AND "${bench_flags} " MATCHES "-whole-module.*" )
375
- list (APPEND common_options "-save-optimization-record" )
376
381
set (opt_view_main_dir "${objdir} /opt-view" )
377
382
endif ()
378
383
endif ()
Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ function(handle_swift_sources
91
91
# FIXME: We shouldn't /have/ to build things in a single process.
92
92
# <rdar://problem/15972329>
93
93
list (APPEND swift_compile_flags "-whole-module-optimization" )
94
+ if (sdk IN_LIST SWIFT_APPLE_PLATFORMS OR sdk STREQUAL "MACCATALYST" )
95
+ list (APPEND swift_compile_flags "-save-optimization-record=bitstream" )
96
+ endif ()
94
97
95
98
_compile_swift_files (
96
99
dependency_target
You can’t perform that action at this time.
0 commit comments