Just like the existing find_as() method, the new insert_as() accepts
an extra parameter which is used as a key to find the bucket in the
map.
When creating a Constant, we want to check the map before actually
creating the object. In this case we have to perform two queries to
the map, and this extra parameter can save recomputing the hash value
for the second query.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM. In the DenseMapInfo, it might be cleaner to store the hash
in the LookupKey as an Optional<unsigned> rather than creating a
third type that the DenseMapInfo understands, but I'm not sure.
Either way seems fine.
Comment Actions
r260458.
I couldn't figure an easy way to merge the two keys, but I only tried to add the hash as an optional in a "tuple" (I guess it requires to expand to a custom class).