[PATCH] D119899: [TableGen] Add a library-based entry point for parsing td files

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 17 09:41:24 PST 2022


nhaehnle added inline comments.


================
Comment at: llvm/lib/TableGen/Parser.cpp:35
+  // After parsing, reset the tablegen data.
+  detail::resetTablegenRecordContext();
+  SrcMgr = SourceMgr();
----------------
rriddle wrote:
> We could do this at the beginning and allow returning the RecordKeeper, but users would have to keep in mind that any successive call to this function will destroy any previously returned RecordKeeper. The current lifetime model of TableGen makes this quite annoying (that is more easily fixable now than it used to be, but someone still needs to put in a lot of the work to plumb through a context everywhere in TableGen code).
This current version seems a reasonable compromise to me as long as all the issues around global state in TableGen haven't been addresses.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119899



More information about the llvm-commits mailing list