This is an archive of the discontinued LLVM Phabricator instance.

[llvm] Add support for hashing std::optional
ClosedPublic

Authored by kazu on Dec 2 2022, 5:37 PM.

Details

Summary

The credit for the hashing code, taken from D138934, goes to Ramkumar
Ramachandra. The test comes from OptionalTest.cpp and updated for
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

Diff Detail

Event Timeline

kazu created this revision.Dec 2 2022, 5:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2022, 5:37 PM
kazu requested review of this revision.Dec 2 2022, 5:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2022, 5:37 PM
dblaikie accepted this revision.Dec 2 2022, 6:48 PM

Looks good (& for the record, is identical to the hash_code implementation and testing for llvm::Optional)

This revision is now accepted and ready to land.Dec 2 2022, 6:48 PM
This revision was landed with ongoing or failed builds.Dec 2 2022, 6:53 PM
This revision was automatically updated to reflect the committed changes.