[all-commits] [llvm/llvm-project] fef3a1: [ADT, Support] Use std::nullopt instead of None (NFC)

kazutakahirata via All-commits all-commits at lists.llvm.org
Fri Dec 2 19:05:12 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fef3a16aeab660d0789c592985993bd68b51f517
      https://github.com/llvm/llvm-project/commit/fef3a16aeab660d0789c592985993bd68b51f517
  Author: Kazu Hirata <kazu at google.com>
  Date:   2022-12-02 (Fri, 02 Dec 2022)

  Changed paths:
    M llvm/include/llvm/ADT/AddressRanges.h
    M llvm/include/llvm/ADT/BreadthFirstIterator.h
    M llvm/include/llvm/ADT/DepthFirstIterator.h
    M llvm/include/llvm/ADT/Optional.h
    M llvm/include/llvm/ADT/STLExtras.h
    M llvm/include/llvm/ADT/StringMapEntry.h
    M llvm/include/llvm/ADT/TinyPtrVector.h
    M llvm/include/llvm/Support/Allocator.h
    M llvm/include/llvm/Support/CheckedArithmetic.h
    M llvm/include/llvm/Support/Error.h
    M llvm/include/llvm/Support/FileUtilities.h
    M llvm/include/llvm/Support/Format.h
    M llvm/include/llvm/Support/FormatProviders.h
    M llvm/include/llvm/Support/InstructionCost.h
    M llvm/include/llvm/Support/JSON.h
    M llvm/include/llvm/Support/MemoryBuffer.h
    M llvm/include/llvm/Support/NativeFormatting.h
    M llvm/include/llvm/Support/VersionTuple.h
    M llvm/include/llvm/Support/VirtualFileSystem.h

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




More information about the All-commits mailing list