This is an archive of the discontinued LLVM Phabricator instance.

[mlir][PDLL] Add symbol support to the PDLL language server
ClosedPublic

Authored by rriddle on Mar 13 2022, 12:47 AM.

Details

Summary

This adds support for documenting the top-level "symbols",
e.g. patterns, constraints, rewrites, etc., within a PDLL file.

Diff Detail

Event Timeline

rriddle created this revision.Mar 13 2022, 12:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2022, 12:47 AM
rriddle requested review of this revision.Mar 13 2022, 12:47 AM
rriddle updated this revision to Diff 415000.Mar 13 2022, 10:16 PM
rriddle edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Mar 16 2022, 12:39 AM
jpienaar accepted this revision.Mar 16 2022, 7:22 PM
jpienaar added inline comments.
mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.cpp
100

Why/What is the consequence of this? And if we restricted to just top-level for symbol would this be useful for where hierarchical is not supported?

mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
551

Could you expand here how this relates to the below assignment? (I don't quite follow how using the nameLoc as the bodyLoc helps here or changes behavior, I'm guessing that it now points to place of template definition)

rriddle updated this revision to Diff 416680.Mar 19 2022, 3:37 AM
rriddle marked 2 inline comments as done.
rriddle added inline comments.Mar 19 2022, 3:38 AM
mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.cpp
100

It changes how we need to construct the symbol set, and I don't have access to an IDE that doesn't support hierarchical to see/decide what is actually useful there. For now though, PDLL doesn't have nested symbols so I just removed the optionality here (this was copied from the MLIR server).

mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
551

Thanks for calling this out, this isn't necessary at this point. It's part of template support, which is a later addition (and would actually make sense when seeing the template code).