[PATCH] D125276: [TableGen] Remove the use of global Record state

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 16:45:49 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/include/llvm/TableGen/Record.h:328
 protected:
+  /// The record keeper that initialized this Init.
+  RecordKeeper &RK;
----------------
Most Inits inherit from TypedInit which has a RecTy. Is possible for the TypedInits to use the RecordKeeper from the the Type? Then only UnsetInit needs an explicit RecordKeeper?

But I guess that means Init::getRecordKeeper would need to examine the `Opc` to determine where to find the RecordKeeper.


================
Comment at: llvm/include/llvm/TableGen/Record.h:1816
+  /// The internal record context used during uniquing.
+  std::unique_ptr<detail::RecordContext> Context;
+
----------------
Why not make the whole Context a member of RecordKeeper? Why go through a pointer?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125276



More information about the llvm-commits mailing list