diff options
author | Maksim Panchenko <maks@fb.com> | 2022-05-19 13:23:40 -0700 |
---|---|---|
committer | Maksim Panchenko <maks@fb.com> | 2022-05-25 13:44:32 -0700 |
commit | bed9efed71b954047aa11d5ed02af433dd9971cf (patch) | |
tree | 0ce7a2d9e92c6ed9c3f33944d176b281e61d1129 /llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp | |
parent | e51a6b7374ca2d11e07375843bf24ef51307308a (diff) | |
download | llvm-bed9efed71b954047aa11d5ed02af433dd9971cf.zip llvm-bed9efed71b954047aa11d5ed02af433dd9971cf.tar.gz llvm-bed9efed71b954047aa11d5ed02af433dd9971cf.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp')
-rw-r--r-- | llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp b/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp index da4d927..1825b95 100644 --- a/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp +++ b/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp @@ -509,7 +509,7 @@ static bool tryAddingSymbolicOperand(int64_t Value, bool isBranch, uint64_t Width, MCInst &MI, const MCDisassembler *Decoder) { return Decoder->tryAddingSymbolicOperand(MI, Value, Address, isBranch, Offset, - Width); + Width, /*InstSize=*/4); } static DecodeStatus DecodeCall(MCInst &MI, unsigned insn, uint64_t Address, |