This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GTY / gengtype question - adding a new header file
- From: "Steve Ellcey " <sellcey at imgtec dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Mon, 31 Aug 2015 14:37:37 -0700
- Subject: GTY / gengtype question - adding a new header file
- Authentication-results: sourceware.org; auth=none
I have a question about gengtype and GTY. I was looking at adding some
code to mips.c and it occurred to me that that file was getting very
large (19873 lines). So I wanted to add a new .c file instead but that
file needed some types that were defined in mips.c and not in a header file.
Specifically it needed the MIPS specific machine_function structure that
is defined in mips.c with:
struct GTY(()) machine_function {....
I think I could just move this to mips.h and things would be fine but
I didn't want to do that because mips.h is included in tm.h and is visible
to the generic GCC code. Currently machine_function is not visible to the
generic GCC code and so I wanted to put machine_function in a header file
that could only be seen/used by mips specific code. So I created
mips-private.h and added it to extra_headers in config.gcc.
The problem is that if I include mips-private.h in mips.c instead of
having the actual definition of machine_function in mips.c then my
build fails and I think it is due to how and where gengtype scans for GTY
uses.
I couldn't find an example of a platform that has a machine specific header
file that was not visible to the generic GCC code and that has GTY types
in it so I am not sure what I need to do to get gengtype to scan
mips-private.h or if this is even possible (or wise).
Steve Ellcey
sellcey@imgtec.com