[PATCH] D158280: [jitlink/rtdydl][checker] Construct disassembler at every decodeInst

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 12:31:11 PDT 2023


lhames added inline comments.


================
Comment at: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp:815
+
+  std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
+  if (!MRI)
----------------
Eymay wrote:
> Maybe getDisassembler and getInstrPrinter could share code for MRI and MAI? 
Looks like MCContext doesn't take ownership -- we're probably leaking them at the moment.

I don't think I'd worry about sharing them (at least not yet -- we could do it as an optimization later). For now I'd be inclined to add a struct to hold on to the MRI and MAI (and any other types that aren't owned) alongside the disassembler / inst-printer.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158280/new/

https://reviews.llvm.org/D158280



More information about the llvm-commits mailing list