[PATCH] D119899: [TableGen] Add a library-based entry point for parsing td files
River Riddle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 15 18:32:39 PST 2022
rriddle added a comment.
In D119899#3325071 <https://reviews.llvm.org/D119899#3325071>, @nhaehnle wrote:
> I'm in favor of exposing this, I actually ran into this problem just yesterday in an external project.
>
> However, the proposed interface using a callback is strange. How about returning an `Expected<RecordKeeper>` instead?
Ah, I think I would be fine going with something like that. The thing I like about the callback approach is that it has more explicit expectations around lifetime, which tablegen right now has a horrible notion of. Not shown here is that to actually properly invoke tablegen multiple times, you need to call llvm_shutdown/reset the global SrcMgr/etc.
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