From bed9efed71b954047aa11d5ed02af433dd9971cf Mon Sep 17 00:00:00 2001 From: Maksim Panchenko Date: Thu, 19 May 2022 13:23:40 -0700 Subject: [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 --- llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp') diff --git a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp index 8bfa70c..9acd492 100644 --- a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp +++ b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp @@ -835,7 +835,8 @@ static bool tryAddingSymbolicOperand(uint64_t Address, int32_t Value, const MCDisassembler *Decoder) { // FIXME: Does it make sense for value to be negative? return Decoder->tryAddingSymbolicOperand(MI, (uint32_t)Value, Address, - isBranch, /* Offset */ 0, InstSize); + isBranch, /*Offset=*/0, /*OpSize=*/0, + InstSize); } /// tryAddingPcLoadReferenceComment - trys to add a comment as to what is being -- cgit v1.1