コード例 #1
0
ファイル: cvise.py プロジェクト: mgorny/cvise
def get_available_pass_groups():
    pass_group_dir = os.path.join(get_share_dir(), "pass_groups")

    if not os.path.isdir(pass_group_dir):
        raise MissingPassGroupsError()

    group_names = []

    for entry in os.listdir(pass_group_dir):
        path = os.path.join(pass_group_dir, entry)

        if not os.path.isfile(path):
            continue

        try:
            pass_group_dict = CVise.load_pass_group_file(path)
            CVise.parse_pass_group_dict(pass_group_dict, set(), None, None,
                                        None, None)
        except MissingPassGroupsError:
            logging.warning(
                "Skipping file {}. Not valid pass group.".format(path))
        else:
            (name, _) = os.path.splitext(entry)
            group_names.append(name)

    return group_names
コード例 #2
0
ファイル: cvise.py プロジェクト: mgorny/cvise
    if sys.platform == "win32":
        pass_options.add(AbstractPass.Option.windows)

    if args.sllooww:
        pass_options.add(AbstractPass.Option.slow)

    if args.pass_group is not None:
        pass_group_file = get_pass_group_path(args.pass_group)
    elif args.pass_group_file is not None:
        pass_group_file = args.pass_group_file
    else:
        pass_group_file = get_pass_group_path("all")

    external_programs = find_external_programs()

    pass_group_dict = CVise.load_pass_group_file(pass_group_file)
    pass_group = CVise.parse_pass_group_dict(pass_group_dict, pass_options,
                                             external_programs,
                                             args.remove_pass,
                                             args.clang_delta_std, args.not_c)
    if args.list_passes:
        logging.info('Available passes:')
        logging.info('INITIAL PASSES')
        for p in pass_group["first"]:
            logging.info(str(p))
        logging.info('MAIN PASSES')
        for p in pass_group["main"]:
            logging.info(str(p))
        logging.info('CLEANUP PASSES')
        for p in pass_group["last"]:
            logging.info(str(p))