#include "tree-pass.h" /* for "current_pass". */
#include "optinfo-emit-json.h"
#include "stringpool.h" /* for get_identifier. */
+#include "spellcheck.h"
/* If non-NULL, return one past-the-end of the matching SUBPART of
the WHOLE string. */
return 1;
}
-int
+void
gcc::dump_manager::
dump_switch_p (const char *arg)
{
for (i = 0; i < m_extra_dump_files_in_use; i++)
any |= dump_switch_p_1 (arg, &m_extra_dump_files[i], true);
-
- return any;
+ if (!any)
+ {
+ auto_vec<const char *> candidates;
+ for (size_t i = TDI_none + 1; i != TDI_end; i++)
+ candidates.safe_push (dump_files[i].swtch);
+ for (size_t i = 0; i < m_extra_dump_files_in_use; i++)
+ candidates.safe_push (m_extra_dump_files[i].swtch);
+ const char *hint = find_closest_string (arg, &candidates);
+ if (hint)
+ error ("unrecognized command-line option %<-fdump-%s%>; "
+ "did you mean %<-fdump-%s%>?", arg, hint);
+ else
+ error ("unrecognized command-line option %<-fdump-%s%>", arg);
+ }
}
/* Parse ARG as a -fopt-info switch and store flags, optgroup_flags
char *
get_dump_file_name (struct dump_file_info *dfi, int part = -1) const;
- int
+ void
dump_switch_p (const char *arg);
/* Start a dump for PHASE. Store user-supplied dump flags in
break;
case OPT_fdump_:
- if (!g->get_dumps ()->dump_switch_p (opt->arg))
- error ("unrecognized command-line option %<-fdump-%s%>", opt->arg);
+ g->get_dumps ()->dump_switch_p (opt->arg);
break;
case OPT_fopt_info_: