[ADT] Define None as std::nullopt (NFC)
authorKazu Hirata <kazu@google.com>
Tue, 22 Nov 2022 17:57:22 +0000 (09:57 -0800)
committerKazu Hirata <kazu@google.com>
Tue, 22 Nov 2022 17:57:22 +0000 (09:57 -0800)
commitabfe65a12b77f9f0292d3ec70bd9fc3b9c13d905
tree86d3f7d761fb7eb3e7c96c0d253d4c89c937e464
parent8fa57a715d56120f1215219a48443da25d2743bd
[ADT] Define None as std::nullopt (NFC)

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

Differential Revision: https://reviews.llvm.org/D138468
llvm/include/llvm/ADT/None.h