[all-commits] [llvm/llvm-project] bed9ef: [MCDisassembler] Disambiguate Size parameter in tr...

maksfb via All-commits all-commits at lists.llvm.org
Wed May 25 13:44:49 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bed9efed71b954047aa11d5ed02af433dd9971cf
      https://github.com/llvm/llvm-project/commit/bed9efed71b954047aa11d5ed02af433dd9971cf
  Author: Maksim Panchenko <maks at fb.com>
  Date:   2022-05-25 (Wed, 25 May 2022)

  Changed paths:
    M llvm/include/llvm-c/DisassemblerTypes.h
    M llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
    M llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h
    M llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h
    M llvm/lib/MC/MCDisassembler/MCDisassembler.cpp
    M llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp
    M llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
    M llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
    M llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.h
    M llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
    M llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h
    M llvm/lib/Target/ARC/Disassembler/ARCDisassembler.cpp
    M llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
    M llvm/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp
    M llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp
    M llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp
    M llvm/lib/Target/SystemZ/Disassembler/SystemZDisassembler.cpp
    M llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp
    M llvm/tools/llvm-objdump/MachODump.cpp
    A llvm/unittests/MC/X86/CMakeLists.txt
    A llvm/unittests/MC/X86/X86MCDisassemblerTest.cpp

  Log Message:
  -----------
  [MCDisassembler] Disambiguate Size parameter in tryAddingSymbolicOperand()

MCSymbolizer::tryAddingSymbolicOperand() overloaded the Size parameter
to specify either the instruction size or the operand size depending on
the architecture. However, for proper symbolic disassembly on X86, we
need to know both sizes, as an instruction can have two operands, and
the instruction size cannot be reliably calculated based on the operand
offset and its size. Hence, split Size into OpSize and InstSize.

For X86, the new interface allows to fix a couple of issues:
  * Correctly adjust the value of PC-relative operands.
  * Set operand size to zero when the operand is specified implicitly.

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




More information about the All-commits mailing list