c++: Expose constexpr hash table
This patch exposes the constexpr hash table so that the modules machinery can save and load constexpr bodies. While there I noticed that we could do a little constification of the hasher and comparator functions. Also combine the saving machinery to a single function returning void -- nothing ever looked at its return value. gcc/cp/ * cp-tree.h (struct constexpr_fundef): Moved from constexpr.c. (maybe_save_constexpr_fundef): Declare. (register_constexpr_fundef): Take constexpr_fundef object, return void. * decl.c (mabe_save_function_definition): Delete, functionality moved to maybe_save_constexpr_fundef. (emit_coro_helper, finish_function): Adjust. * constexpr.c (struct constexpr_fundef): Moved to cp-tree.h. (constexpr_fundef_hasher::equal): Constify. (constexpr_fundef_hasher::hash): Constify. (retrieve_constexpr_fundef): Make non-static. (maybe_save_constexpr_fundef): Break out checking and duplication from ... (register_constexpr_fundef): ... here. Just register the constexpr.
Loading
Please register or sign in to comment