Use None consistently (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 20 Nov 2022 08:24:40 +0000 (00:24 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 20 Nov 2022 08:24:40 +0000 (00:24 -0800)
commit1fa870b1bd6c0041d06c31c4d3c830713d0a2a3f
treea8563d5204142332f770dc9c8d5ead133ef04712
parent92bccf5d3d2122d57f12dc07d4781e90edefd7ef
Use None consistently (NFC)

This patch replaces NoneType() and NoneType::None with None in
preparation for migration from llvm::Optional to std::optional.

In the std::optional world, we are not guranteed to be able to
default-construct std::nullopt_t or peek what's inside it, so neither
NoneType() nor NoneType::None has a corresponding expression in the
std::optional world.

Once we consistently use None, we should even be able to replace the
contents of llvm/include/llvm/ADT/None.h with something like:

  using NoneType = std::nullopt_t;
  inline constexpr std::nullopt_t None = std::nullopt;

to ease the migration from llvm::Optional to std::optional.

Differential Revision: https://reviews.llvm.org/D138376
21 files changed:
bolt/include/bolt/Core/BinaryContext.h
bolt/include/bolt/Core/BinaryFunction.h
bolt/include/bolt/Core/MCPlusBuilder.h
bolt/lib/Core/BinaryContext.cpp
bolt/lib/Core/MCPlusBuilder.cpp
bolt/lib/Profile/BoltAddressTranslation.cpp
bolt/lib/Profile/DataAggregator.cpp
bolt/lib/Profile/DataReader.cpp
bolt/lib/Rewrite/RewriteInstance.cpp
bolt/lib/Target/X86/X86MCPlusBuilder.cpp
bolt/lib/Utils/Utils.cpp
clang/lib/Driver/ToolChains/HLSL.cpp
lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp
llvm/include/llvm/Analysis/InlineAdvisor.h
llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp
llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp
llvm/unittests/IR/MetadataTest.cpp
mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp