Skip to content

Commit 87a0ad1

Browse files
committed
[build-script] Add an option to build-script called --lto that unifies the triggering of ltoing llvm/swift tools.
Also change the relevant build-presets to use this flag instead of touching build-script-impl directly. rdar://24717107
1 parent 73c3711 commit 87a0ad1

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

utils/build-presets.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,15 @@ test-optimized=0
182182
mixin-preset=
183183
mixin_buildbot_tools_RA_stdlib_RDA
184184

185+
lto
186+
185187
dash-dash
186188

187189
# Don't run host tests for iOS, tvOS and watchOS platforms to make the build
188190
# faster.
189191
skip-test-ios-host
190192
skip-test-tvos-host
191193
skip-test-watchos-host
192-
swift-enable-lto
193-
llvm-enable-lto
194194

195195
#===------------------------------------------------------------------------===#
196196
# Incremental buildbots for Darwin OSes
@@ -415,9 +415,9 @@ skip-build-benchmarks
415415
mixin-preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx
416416
build-subdir=buildbot_incremental
417417

418-
dash-dash
418+
lto
419419

420-
swift-enable-lto
420+
dash-dash
421421

422422
[preset: buildbot_incremental,tools=RA,llvm-only]
423423
build-subdir=buildbot_incremental_llvmonly

utils/build-script

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,16 @@ details of the setups of other systems or automated environments.""")
976976
default=False,
977977
const=True)
978978

979+
parser.add_argument(
980+
"--lto",
981+
help="use lto optimization on llvm/swift tools. This does not "
982+
"imply using lto on the swift standard library or runtime",
983+
metavar="BOOL",
984+
nargs='?',
985+
type=arguments.type.bool,
986+
default=False,
987+
const=True)
988+
979989
parser.add_argument(
980990
# Explicitly unavailable options here.
981991
"--build-jobs",
@@ -1442,6 +1452,12 @@ details of the setups of other systems or automated environments.""")
14421452
pipes.quote(opt) for opt in args.extra_cmake_options)
14431453
]
14441454

1455+
if args.lto:
1456+
build_script_impl_args += [
1457+
"--llvm-enable-lto",
1458+
"--swift-enable-lto"
1459+
]
1460+
14451461
build_script_impl_args += args.build_script_impl_args
14461462

14471463
if args.dry_run:

0 commit comments

Comments
 (0)