[all-commits] [llvm/llvm-project] 1fa870: Use None consistently (NFC)

kazutakahirata via All-commits all-commits at lists.llvm.org
Sun Nov 20 00:24:55 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1fa870b1bd6c0041d06c31c4d3c830713d0a2a3f
      https://github.com/llvm/llvm-project/commit/1fa870b1bd6c0041d06c31c4d3c830713d0a2a3f
  Author: Kazu Hirata <kazu at google.com>
  Date:   2022-11-20 (Sun, 20 Nov 2022)

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

  Log Message:
  -----------
  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




More information about the All-commits mailing list