[all-commits] [llvm/llvm-project] 1e7101: [lldb][NFCI] TestEmulation should take a Stream ref

Alex via All-commits all-commits at lists.llvm.org
Mon Jul 10 11:19:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e7101a3d95884c791d566b7b6192fbac55f55e0
      https://github.com/llvm/llvm-project/commit/1e7101a3d95884c791d566b7b6192fbac55f55e0
  Author: Alex Langford <alangford at apple.com>
  Date:   2023-07-10 (Mon, 10 Jul 2023)

  Changed paths:
    M lldb/include/lldb/Core/Disassembler.h
    M lldb/include/lldb/Core/EmulateInstruction.h
    M lldb/source/API/SBInstruction.cpp
    M lldb/source/Core/Disassembler.cpp
    M lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
    M lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h
    M lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
    M lldb/source/Plugins/Instruction/ARM/EmulationStateARM.h
    M lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h
    M lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp
    M lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.h
    M lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h
    M lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
    M lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.h
    M lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp
    M lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h

  Log Message:
  -----------
  [lldb][NFCI] TestEmulation should take a Stream ref

`Instruction::TestEmulation` takes a `Stream *` and checks it for validity.
However, this is unnecessary as we can always ensure that we never pass
`nullptr` for the `Stream` argument. The only use of
`Instruction::TestEmulation` currently is `SBInstruction::TestEmulation`
which gets the `Stream` from an `SBStream`, and `SBStream::ref` can
return a `Stream &` guaranteed.

Differential Revision: https://reviews.llvm.org/D154757




More information about the All-commits mailing list