2 Commits

Author SHA1 Message Date
Venkata Ramanaiah Nalamothu
dfa8a15d78 [lldb][NFC] Put disassembler test classes and methods in anonymous namespace
Reviewed By: DavidSpickett, MaskRay

Differential Revision: https://reviews.llvm.org/D158971
2023-09-01 11:49:54 +05:30
Venkata Ramanaiah Nalamothu
254a31273a [lldb][NFC] Use MCInstrAnalysis when available in the disassembler plugin
Since the info in MCInstrDesc is based on opcodes only, it is often quite
inaccurate. The MCInstrAnalysis has been added so that targets can provide
accurate info, which is based on registers used by the instruction, through
the own versions of MCInstrDesc functions.

The RISCVMCInstrAnalysis, which needs to refine several MCInstrDesc methods,
is a good example for this.

Given the llvm-objdump also uses MCInstrAnalysis, I think this change is in
the right direction.

The default implementation of MCInstrAnalysis methods forward the query to
MCInstrDesc functions. Hence, no functional change is intended/expected.

To avoid bloating up MCInstrAnalysis, only the methods provided by it and
the ones used by disassembler plugin are changed to use MCInstrAnalysis when
available.

Though I am not sure if it will be useful, making MCInstrAnalysis available
in the disassembler plugin would allow enabling symbolize operands (D84191)
feature in lldb's disassembler as well.

Reviewed By: jasonmolenda

Differential Revision: https://reviews.llvm.org/D156086
2023-08-14 08:37:41 +05:30