This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add target hook in C front end

> Add two new entries to struct cpp_callbacks in cpplib.h.  One gets
> called in cpp_handle_option, when you encounter an -m switch.  (You'll
> need to treat -m rather like -W.)  The other gets called from
> cpp_start_read right before we process -D switches.

Is this necessary?  I suspect we can handle this without touching
cpplib at all.

The -m switches in the front ends are handled, to the best of my
knowledge, by toplev.c's independent_decode_option().  This in turn
passes it on to set_target_switch().

We are just looking for a short-term fix here until something
universal and better comes along, so, why can't the target-specific
code figure it out for itself?  Then all we need to do is give the
target-specific code a chance (if one doesn't exist already) to call
cpp_define once the options are all parsed.  This could, at worst, be
done with a couple of lines in toplev.c.  Sound reasonable?

> Add two target macros, say TARGET_CPP_PROCESS_OPTIONS and

I _think_ this is overkill, though I'm by no means sure.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]