[llvm] [RemoveDIs][DebugInfo][IR] Add parsing for non-intrinsic debug values (PR #79818)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 07:37:37 PST 2024


SLTozer wrote:

> I've got a slight twitching feeling about the addition of the debug-records as keywords (well, Identifiers) as it seems like quite a large commitment. However: we can always change the manner in which it's parsed, I think the format is good.

I get similar twitches, but at the same time it makes sense - the model here is the same, imo, as how we use a bunch of keywords - the names `dbg_foo` shouldn't clash with anything that currently exists, and they represent a small group of strings that, while it might be added to over compiler releases, is fixed for any given version of the compiler.

> I'm not completely certain about making the mixing of debug-info formats a parsing error: wouldn't it be more natural to defer it until the Verifier? 

There's been a lot of uncertainty for me over where to spread the checks between the parser and the verifier; one of the advantages of placing the checks in the parser is that we can give the user the actual location of a violating instance, while in the verifier not only can we not give a line+col position, but the original intrinsic may have been morphed by an upgrade (old IR files may contain dbg.values with extra arguments, for example), making it non-trivial to figure out where the offending line is, or what the problem is at all if you're unfamiliar with the new/old formats. On the other hand, it _is_ aggressive to put these checks in the parser, so I'm open to changing it.

https://github.com/llvm/llvm-project/pull/79818


More information about the llvm-commits mailing list