[llvm] Allow MCInstrAnalysis to change MCInst (PR #85906)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 03:54:45 PDT 2024


================
@@ -52,6 +53,10 @@ class MCInstrAnalysis {
   /// new function), clients should call resetState to clear it.
   virtual void updateState(const MCInst &Inst, uint64_t Addr) {}
 
+  /// Let the analysis update disassembled instruction from a recorded internal
+  /// state.
----------------
jayfoad wrote:

Agreed. In this case I think the justification is that the mutation just records some helpful extra info in the MCInst that would not affect the encoding of the instruction (and I guess we could verify that).

We did also discuss offline a way to avoid this altogether, by getting the target InstPrinter::printOperand to query the MCInstrAnalysis directly.

https://github.com/llvm/llvm-project/pull/85906


More information about the llvm-commits mailing list