[all-commits] [llvm/llvm-project] fdbe7c: [lldb] Refactor OptionValue to return a std::optio...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Mon May 1 21:08:37 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fdbe7c7faa547b16bf6da0fedbb7234b6ee3adef
      https://github.com/llvm/llvm-project/commit/fdbe7c7faa547b16bf6da0fedbb7234b6ee3adef
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2023-05-01 (Mon, 01 May 2023)

  Changed paths:
    M lldb/include/lldb/Interpreter/OptionValue.h
    M lldb/source/Commands/CommandObjectBreakpoint.cpp
    M lldb/source/Commands/CommandObjectMemory.cpp
    M lldb/source/Commands/CommandObjectRegister.cpp
    M lldb/source/Core/Disassembler.cpp
    M lldb/source/Interpreter/OptionValue.cpp
    M lldb/source/Interpreter/OptionValueArgs.cpp
    M lldb/source/Interpreter/OptionValueArray.cpp
    M lldb/source/Interpreter/OptionValueProperties.cpp
    M lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
    M lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
    M lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
    M lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp

  Log Message:
  -----------
  [lldb] Refactor OptionValue to return a std::optional (NFC)

Refactor OptionValue to return a std::optional instead of taking a fail
value. This allows the caller to handle situations where there's no
value, instead of being unable to distinguish between the absence of a
value and the value happening the match the fail value. When a fail
value is required, std::optional::value_or() provides the same
functionality.




More information about the All-commits mailing list