[llvm] [RemoveDIs][DebugInfo][IR] Add parsing for non-intrinsic debug values (PR #79818)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 01:44:14 PST 2024
SLTozer wrote:
> Let me know if this has been discussed elsewhere, but why is necessary to add a new `#` token to the grammar?
The purpose of the leading `#` is to create a syntactic distinction from instructions. Without using a leading symbol to specify that a non-instruction line is beginning, the only discriminating feature would be whitespace - which is not clear enough by itself, and can't be used by the parser.
The reason why `#` specifically is used here is simply that it's free real estate - most other symbols that LLVM uses followed by letters are already classified as specific tokens (i.e. `!foo`, `@foo`, `$foo`, etc) that we'd ideally avoid overloading if alternatives are available.
https://github.com/llvm/llvm-project/pull/79818
More information about the llvm-commits
mailing list