[PATCH] D141511: [ARM] Use MCInstrInfo::get in ARMDisassembler instead of reinventing it
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 11 08:35:39 PST 2023
foad added reviewers: t.p.northover, asl, rengolin.
foad added inline comments.
================
Comment at: llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp:133
public:
- ARMDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx) :
- MCDisassembler(STI, Ctx) {
+ std::unique_ptr<const MCInstrInfo> MCII;
+
----------------
This is the pattern used by AArch64 and other disassemblers I looked at.
================
Comment at: llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp:1638
+ const MCInstrInfo *MCII =
+ static_cast<const ARMDisassembler *>(Decoder)->MCII.get();
+ if (Val != ARMCC::AL && !MCII->get(Inst.getOpcode()).isPredicable())
----------------
It is slightly ugly having to down-cast here but I assume it is safe.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141511/new/
https://reviews.llvm.org/D141511
More information about the llvm-commits
mailing list