This is an archive of the discontinued LLVM Phabricator instance.

[ADT] Define None as std::nullopt (NFC)
ClosedPublic

Authored by kazu on Nov 21 2022, 7:20 PM.

Details

Summary

This patch defines NoneType and None as std::nullopt_t and
std::nullopt, respectively.

This patch effectively makes None and std::nullopt interchangeable, so
we can gradually replace None with std::nullopt all while we continue
to use llvm::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.Nov 21 2022, 7:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 21 2022, 7:20 PM
kazu requested review of this revision.Nov 21 2022, 7:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 21 2022, 7:20 PM
dblaikie accepted this revision.Nov 22 2022, 9:48 AM

Awesome :) (great to have inline variables now - was a bit of a pain working around that in the past)

This revision is now accepted and ready to land.Nov 22 2022, 9:48 AM
This revision was landed with ongoing or failed builds.Nov 22 2022, 9:57 AM
This revision was automatically updated to reflect the committed changes.