c++: Expose constexpr hash table

Nathan Sidwell nathan@acm.org
Thu Nov 19 20:21:21 GMT 2020


Again, I noticed some cleanups on the way to preparing this exposure of 
the constexpr hash table.  Committing this to trunk

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.


-- 
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 17a-c++-infra-constexpr.diff
Type: text/x-patch
Size: 8775 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201119/4bea45e5/attachment-0001.bin>


More information about the Gcc-patches mailing list