Skip to content
Snippets Groups Projects
Commit bfc139e2 authored by Nathan Sidwell's avatar Nathan Sidwell
Browse files

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.
parent 0862d007
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment