[ADT, Support] Use std::nullopt instead of None (NFC)
authorKazu Hirata <kazu@google.com>
Sat, 3 Dec 2022 03:04:57 +0000 (19:04 -0800)
committerKazu Hirata <kazu@google.com>
Sat, 3 Dec 2022 03:04:57 +0000 (19:04 -0800)
commitfef3a16aeab660d0789c592985993bd68b51f517
treee24bbf89fb0e58bb8a67f58db92d2928593953df
parentd62480c1995b32eea8b9ed5a92829ee5615c4750
[ADT, Support] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated.  The intent is to reduce
the amount of manual work required in migrating from Optional to
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

Differential Revision: https://reviews.llvm.org/D139241
19 files changed:
llvm/include/llvm/ADT/AddressRanges.h
llvm/include/llvm/ADT/BreadthFirstIterator.h
llvm/include/llvm/ADT/DepthFirstIterator.h
llvm/include/llvm/ADT/Optional.h
llvm/include/llvm/ADT/STLExtras.h
llvm/include/llvm/ADT/StringMapEntry.h
llvm/include/llvm/ADT/TinyPtrVector.h
llvm/include/llvm/Support/Allocator.h
llvm/include/llvm/Support/CheckedArithmetic.h
llvm/include/llvm/Support/Error.h
llvm/include/llvm/Support/FileUtilities.h
llvm/include/llvm/Support/Format.h
llvm/include/llvm/Support/FormatProviders.h
llvm/include/llvm/Support/InstructionCost.h
llvm/include/llvm/Support/JSON.h
llvm/include/llvm/Support/MemoryBuffer.h
llvm/include/llvm/Support/NativeFormatting.h
llvm/include/llvm/Support/VersionTuple.h
llvm/include/llvm/Support/VirtualFileSystem.h