File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -810,6 +810,12 @@ class BuildScriptInvocation(object):
810
810
if args .dry_run :
811
811
impl_args += ["--dry-run" ]
812
812
813
+ if args .clang_profile_instr_use :
814
+ impl_args += [
815
+ "--clang-profile-instr-use=%s" %
816
+ os .path .abspath (args .clang_profile_instr_use )
817
+ ]
818
+
813
819
if args .lit_args :
814
820
impl_args += ["--llvm-lit-args=%s" % args .lit_args ]
815
821
@@ -1985,6 +1991,11 @@ details of the setups of other systems or automated environments.""")
1985
1991
const = 'full' ,
1986
1992
dest = 'lto_type' )
1987
1993
1994
+ parser .add_argument (
1995
+ "--clang-profile-instr-use" ,
1996
+ help = "profile file to use for clang PGO" ,
1997
+ metavar = "PATH" )
1998
+
1988
1999
default_max_lto_link_job_counts = host .max_lto_link_job_counts ()
1989
2000
parser .add_argument (
1990
2001
"--llvm-max-parallel-lto-link-jobs" ,
Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ KNOWN_SETTINGS=(
237
237
user-config-args " " " **Renamed to --extra-cmake-options**: User-supplied arguments to cmake when used to do configuration."
238
238
only-execute " all" " Only execute the named action (see implementation)"
239
239
llvm-lit-args " " " If set, override the lit args passed to LLVM"
240
+ clang-profile-instr-use " " " If set, profile file to use for clang PGO"
240
241
coverage-db " " " If set, coverage database to use when prioritizing testing"
241
242
build-toolchain-only " " " If set, only build the necessary tools to build an external toolchain"
242
243
)
@@ -740,6 +741,12 @@ function set_build_options_for_host() {
740
741
)
741
742
fi
742
743
744
+ if [[ " ${CLANG_PROFILE_INSTR_USE} " ]]; then
745
+ llvm_cmake_options+=(
746
+ -DLLVM_PROFDATA_FILE=" ${CLANG_PROFILE_INSTR_USE} "
747
+ )
748
+ fi
749
+
743
750
swift_cmake_options+=(
744
751
-DCOVERAGE_DB=" ${COVERAGE_DB} "
745
752
)
You can’t perform that action at this time.
0 commit comments