[llvm] [LoongArch][Disassembler] Add symbolic operands for decoded immediates (PR #217971)

Rong Mantle Bao via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 03:09:18 PDT 2026


================
@@ -142,18 +142,28 @@ static DecodeStatus decodeUImmOperand(MCInst &Inst, uint64_t Imm,
                                       int64_t Address,
                                       const MCDisassembler *Decoder) {
   assert(isUInt<N>(Imm) && "Invalid immediate");
-  Inst.addOperand(MCOperand::createImm(Imm + P));
+  const int64_t DecodedImm = Imm + P;
+  if (!Decoder->tryAddingSymbolicOperand(Inst, DecodedImm, Address,
+                                         /*IsBranch=*/false, 0, 0, 4))
----------------
CSharperMantle wrote:

Will update in v2.

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


More information about the llvm-commits mailing list