Lines Matching refs:options
88 def make_clang_command_line(plugin, plugin_args, options):
89 arch_cfg = ARCHITECTURES[options.v8_target_cpu]
99 log("Using generated files in {}", options.v8_build_dir / 'gen')
100 icu_src_dir = options.v8_root_dir / 'third_party/icu/source'
102 options.clang_bin_dir / "clang++",
108 options.clang_plugins_dir / "libgcmole.so",
126 "-I{}".format(options.v8_root_dir),
127 "-I{}".format(options.v8_root_dir / 'include'),
128 "-I{}".format(options.v8_build_dir / 'gen'),
165 def invoke_clang_plugin_for_each_file(filenames, plugin, plugin_args, options):
166 cmd_line = make_clang_command_line(plugin, plugin_args, options)
167 verbose = options.verbose
168 if options.sequential:
225 def parse_gn_file(options, for_test):
227 return {"all": [options.v8_root_dir / "tools/gcmole/gcmole-test.cc"]}
235 path = options.v8_root_dir / filename
243 result[condition].append(options.v8_root_dir / prefix / file)
262 def build_file_list(options, for_test):
263 sources = parse_gn_file(options, for_test)
266 "arch": options.v8_target_cpu,
331 def __init__(self, options):
336 self.allowlist = options.allowlist
386 def generate_gc_suspects(files, options):
388 collector = GCSuspectsCollector(options)
390 log("Building GC Suspects for {}", options.v8_target_cpu)
392 [], options):
396 write_gcmole_results(collector, options, options.v8_root_dir)
397 write_gcmole_results(collector, options, options.out_dir)
400 def write_gcmole_results(collector, options, dst):
432 log("GCSuspects and gccauses generated for {} in '{}'", options.v8_target_cpu,
440 def check_correctness_for_arch(options, for_test):
441 files = build_file_list(options, for_test)
443 if not options.reuse_gcsuspects:
444 generate_gc_suspects(files, options)
446 log("Reusing GCSuspects for {}", options.v8_target_cpu)
453 (' and dead variables' if options.dead_vars else '') + "for" +
454 options.v8_target_cpu)
456 if options.dead_vars:
458 if options.verbose:
460 if options.verbose_trace:
463 plugin_args, options):
479 def test_run(options):
480 if not options.test_run:
483 errors_found, output = check_correctness_for_arch(options, True)
489 new_file = options.out_dir / "test-expectations-gen.txt"
494 expected_file = options.v8_root_dir / "tools/gcmole/test-expectations.txt"
499 diff_file = options.out_dir / "test_output.diff"
582 group = optparse.OptionGroup(parser, "GCMOLE options")
625 (options, args) = parser.parse_args()
627 if not options.v8_target_cpu:
630 options.v8_target_cpu = args[0]
631 log("Using --v8-target-cpu={}", options.v8_target_cpu)
635 options.is_bot = False
636 verify_and_convert_dirs(parser, options, gcmole_dir, default_clang_bin_dir)
637 verify_clang_plugin(parser, options)
638 prepare_gcmole_files(options)
639 verify_build_config(parser, options)
642 if not test_run(options):
645 errors_found, output = check_correctness_for_arch(options, False)
651 def verify_and_convert_dirs(parser, options, gcmole_dir, default_clang_bin_dir):
652 # Verify options for setting directors and convert the input strings to Path
654 options.v8_root_dir = Path(options.v8_root_dir)
656 if not options.clang_bin_dir:
658 options.clang_bin_dir = Path(os.getenv("CLANG_BIN"))
659 options.is_bot = True
661 options.clang_bin_dir = default_clang_bin_dir
662 if not (options.clang_bin_dir / 'clang++').exists():
663 options.clang_bin_dir = Path(gcmole_dir,
665 log("Using --clang-bin-dir={}", options.clang_bin_dir)
667 options.clang_bin_dir = Path(options.clang_bin_dir)
669 if not options.clang_plugins_dir:
671 options.clang_plugins_dir = Path(os.getenv("CLANG_PLUGINS"))
673 options.clang_plugins_dir = gcmole_dir.resolve()
674 log("Using --clang-plugins-dir={}", options.clang_plugins_dir)
676 options.clang_plugins_dir = Path(options.clang_plugins_dir)
678 if not options.v8_build_dir:
679 config = ARCHITECTURES[options.v8_target_cpu]
680 options.v8_build_dir = options.v8_root_dir / ('out/%s.release' %
683 if not options.v8_build_dir.exists() and os.getenv("CLANG_BIN"):
684 options.v8_build_dir = options.v8_root_dir / 'out/build'
685 log("Using --v8-build-dir={}", options.v8_build_dir)
687 options.v8_build_dir = Path(options.v8_build_dir)
689 if not options.out_dir:
690 options.out_dir = options.v8_build_dir / 'gen/tools/gcmole'
691 if options.v8_build_dir.exists():
692 options.out_dir.mkdir(parents=True, exist_ok=True)
694 options.out_dir = Path(options.out_dir)
700 dir = getattr(options, parser.get_option(flag).dest)
705 def verify_clang_plugin(parser, options):
706 libgcmole_path = options.clang_plugins_dir / "libgcmole.so"
710 clang_path = options.clang_bin_dir / "clang++"
716 def prepare_gcmole_files(options):
718 "ninja", "-C", options.v8_build_dir, "v8_gcmole_files",
727 if options.is_bot:
733 def verify_build_config(parser, options):
734 if options.is_bot:
737 config_file = options.v8_build_dir / 'v8_build_config.json'
743 if found_cpu == options.v8_target_cpu:
746 options.v8_build_dir, options.v8_target_cpu, found_cpu))