$target.h vs $target-protos.h

Richard Sandiford richard.sandiford@linaro.org
Fri Feb 23 18:12:00 GMT 2018


Joseph Myers <joseph@codesourcery.com> writes:
> On Mon, 19 Feb 2018, Sandra Loosemore wrote:
>
>> On 02/19/2018 09:45 AM, Joseph Myers wrote:
>> > On Sun, 18 Feb 2018, Sandra Loosemore wrote:
>> > 
>> > > Thanks, this makes sense.  I think I could produce a documentation patch
>> > > that
>> > > explains that the difference is early vs late inclusion, and explains that
>> > > any
>> > > declarations involving tree or rtx types must go in $target-protos.h
>> > > because
>> > > those types are not defined when $target.h is included.
>> > 
>> > That's not the case now for tree or rtx types, since they're (forward)
>> > declared in coretypes.h.  It may still be the case for some types, but not
>> > those.
>> 
>> OK, I think I misunderstood your previous message -- it's the
>> machine_mode-related types that have the circular dependency, but rtx and tree
>> no longer do.  Is that right?
>
> The machine_mode-related types don't either (since coretypes.h includes 
> insn-modes.h and machmode.h).  Some types may well still have that 
> dependency, but I don't know which.

The main one I remember is rtx_code, but that can only be used in
$target-protos.h when RTX_CODE is defined.

Richard



More information about the Gcc mailing list