On 05/08/2015 10:38 AM, David Malcolm wrote:
I tested your branch (at 09263eae7c260c305fa19ffa186afd1d89654fb8) with
the jit configuration from the docs:
../src/configure \
--enable-host-shared \
--enable-languages=jit,c++ \
--disable-bootstrap \
--enable-checking=release \
--prefix=$PREFIX
Sadly, the jit "frontend" fails to compile:
Whoops. My bad. I was unaware `jit' needed to be added to
--enable-languages. I thought it was tested automatically.
../../src/gcc/jit/jit-playback.c: In member function ‘void
gcc::jit::playback::context::write_global_decls_2()’:
../../src/gcc/jit/jit-playback.c:710:20: error: ‘const struct
gcc_debug_hooks’ has no member named ‘global_decl’
debug_hooks->global_decl (decl);
The basic idea is that if your globals do NOT make it to
rest_of_decl_compilation(), you need to call
debug_hooks->early_global_decl() on them manually after parsing.
On the other hand, if your functions do NOT make it to the symbol table
then you also need to call debug_hooks->early_global_decl() on them
after parsing (see finalize_compilation_unit()).
The call to debug_hooks->late_global_decl() should be handled
automagically. I mean, I assume your symbols (functions and globals,
etc) make it to the symbol table, in which case they'll be picked up by
either compile_file() or by analyze_functions(). The latter in case the
symbol was optimized away and is about to be removed from the symbol table.
Does this help? If it doesn't, I can gladly take over this on Monday.
^
since the "global_decl" debug hook has gone away. I see that
LANG_HOOKS_WRITE_GLOBALS
also is no more, and this leads to various code in the jit becoming
dead:
../../src/gcc/jit/dummy-frontend.c:225:1: warning: ‘void
jit_langhook_write_globals()’ defined but not used [-Wunused-function]
The attached patch gets it to compile, and eliminates the now-dead code,
but it's not clear to me how global variables are meant to be created in
the debug-early world.
Thanks for working on this.
Aldy