do_merge
/* Driver for profile merge sub-command. */
static int
do_merge (int argc, char **argv)
{
int opt;
const char *output_dir = 0;
int w1 = 1, w2 = 1;
optind = 0;
while ((opt = getopt_long (argc, argv, "vo:w:", merge_options, NULL)) != -1)
{
switch (opt)
{
case 'v':
verbose = true;
gcov_set_verbose ();
break;
case 'o':
output_dir = optarg;
break;
case 'w':
sscanf (optarg, "%d,%d", &w1, &w2);
if (w1 < 0 || w2 < 0)
fatal_error (input_location, "weights need to be non-negative\n");
break;
default:
merge_usage ();
}
}
if (output_dir == NULL)
output_dir = "merged_profile";
if (argc - optind != 2)
merge_usage ();
return profile_merge (argv[optind], argv[optind+1], output_dir, w1, w2);
}