Skip to content

Commit d93c0ae

Browse files
Fail fast in IR extraction if using local thinLTO and an input (#179)
ThinTLO corpus extraction in extract_ir.py is designed to be used without an input file (ie an lld params file or a compile_commands.json). However, if the user passes in an input while trying to do local thinLTO corpus extraction the extraction might partially succeed, or even fully succeed without giving any indication of what might be amiss. This patch makes these configurations error out to reduce confusion.
1 parent bbe20bc commit d93c0ae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler_opt/tools/extract_ir.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ def main(argv):
320320
flags.mark_flags_as_required(['output_dir'])
321321

322322
objs = []
323+
if FLAGS.input is not None and FLAGS.thinlto_build == 'local':
324+
raise ValueError('--thinlto_build=local cannot be run with --input')
323325
if FLAGS.input is None:
324326
if FLAGS.thinlto_build != 'local':
325327
raise ValueError('--input or --thinlto_build=local must be provided')

0 commit comments

Comments
 (0)