On Mon, Jul 13, 2026 at 4:53 PM Nathan Sidwell <[email protected]> wrote:
>
> The passed.def & target-specific extra passes files are C++ source, #included
> into the compiler.
>
> But, they're also processed by an AWK script.  That script simply looks for 3
> special macro names, regardless of context.
>
> Thus to (temporarily) disable a pass, one must both
> a) line-comment it out
> b) change the macro name, (by inserting a space or similar)
>
> This annoying.
>
> I contemplated just changing AWK to only accept the names at the beginning of 
> a
> line (with whitespace), but then considered just running the C preprocessor
> first -- that way one gets all the CPP behaviour and no surprises.
>
> Here's a patch to do the latter.  Because these are .def files you need to 
> tell
> the preprocessor it's C (or maybe pipe into stdin?), and one also needs to 
> strip
> the '# N FILE' line markers produced, to avoid later warnings about those 
> being
> a GCC extension.
>
> I'm guessing '-x c' is going to be accepted by other compilers, given both gcc
> and clang grok it.  If one goes the stdin route, one doesn't need that.

Hmm, I'm not sure it's good to open up the can of worms of using the host
preprocessor (is there a CPP_FOR_BUILD?).  Can't you fix the awk script
to honor comments?  Can't we perform what the awk script does by
clever use of C++ constexpr of some sorts?

>
> nathan
>
> --
> Nathan Sidwell

Reply via email to