Hi, Ian Lance Taylor <i...@google.com> writes:
> ludovic.cour...@inria.fr (Ludovic Courtès) writes: > >> ‘c-common.h’ lacks this declaration: >> >> extern tree xref_tag (enum tree_code code, tree name); >> >> AFAICS it makes it impossible for plug-ins to lookup a struct/union/enum >> tag. >> >> Unfortunately, <cp/cp-tree.h> declares a different ‘xref_tag’ function, >> so it seems that the above declaration cannot just be added to >> ‘c-common.h’. >> >> Any ideas how to solve this? > > Any plugin that uses that function is going to be inherently specific to > the C frontend, and will not work with C++. How would you recommend to work around the problem in the meantime? > So it will have to #include > c-tree.h. That in turn would presumably require adding $(C_TREE_H) to > PLUGIN_HEADERS in gcc/Makefile.in. See patch below (INRIA has a copyright assignment on file):
From: Ludovic Courtès <l...@gnu.org> Subject: [PATCH] t/install-c-tree-h Install <c-tree.h>, for use by plug-ins. Signed-off-by: Ludovic Courtès <l...@gnu.org> --- gcc/ChangeLog | 5 +++++ gcc/Makefile.in | 3 ++- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5ee0836..db68fdf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-03-16 Ludovic Courtès <ludovic.cour...@inria.fr> + + * Makefile.in (PLUGIN_HEADERS): Add $(C_TREE_H). Suggested by + Ian Lance Taylor <i...@google.com>. + 2011-03-16 Jakub Jelinek <ja...@redhat.com> * emit-rtl.c (try_split): Don't call copy_call_info debug hook. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index b4de74b..393c0c4 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -4519,7 +4519,8 @@ PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(EXCEPT_H) tree-ssa-sccvn.h real.h output.h $(IPA_UTILS_H) \ $(C_PRAGMA_H) $(CPPLIB_H) $(FUNCTION_H) \ cppdefault.h flags.h $(MD5_H) params.def params.h prefix.h tree-inline.h \ - $(IPA_PROP_H) $(RTL_H) $(TM_P_H) $(CFGLOOP_H) $(EMIT_RTL_H) version.h + $(IPA_PROP_H) $(RTL_H) $(TM_P_H) $(CFGLOOP_H) $(EMIT_RTL_H) version.h \ + $(C_TREE_H) # generate the 'build fragment' b-header-vars s-header-vars: Makefile -- tg: (18b7c11..) t/install-c-tree-h (depends on: master)
Thanks, Ludo’.