On Fri, 14 Aug 2015, Thomas Schwinge wrote:

> Can you suggest off-hand where you'd expect this option filtering to
> happen?  Should this be during specs parsing in the driver; something
> like adding a lang_mask to gcc/gcc.c:struct switchstr, and then in
> gcc/gcc.c:give_switch ignore any switches that don't match the expected
> CL_*?  I seem to have difficulties to properly populate/deduce that
> lang_mask at the call sites of gcc/gcc.c:save_switch.  Or, did you
> imagine that to be done differently?

I don't have a particular design in mind; I was simply noting that the 
relevant information is available to the driver through the option 
handling data.

> Alternatively, what about changing gcc/opts-global.c:complain_wrong_lang
> to silently ignore options that don't apply instead of emitting a »is
> valid for [...] but not for [...]« diagnostic, if a (new) flag
> (-f[something]?) has been set, which would be active only during the
> add-omp-infile compilation?

That would be a possibility, yes.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to