[PATCH] D115353: Verifier: accept enums as scopes

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 14:03:16 PST 2021


dblaikie added a comment.

In D115353#3183820 <https://reviews.llvm.org/D115353#3183820>, @ychen wrote:

> In D115353#3183713 <https://reviews.llvm.org/D115353#3183713>, @dblaikie wrote:
>
>> In D115353#3179986 <https://reviews.llvm.org/D115353#3179986>, @ychen wrote:
>>
>>> Oops, apologies for breaking Rust. I'm no debuginfo expert, just wondering if we could keep this check for C/C++?
>>
>> Reckon it's worth the special case, though? I don't feel super strongly either way - I guess we already do have the "CurrentSourceLang" there and use it for some fortran special case, so we could test it here too. But I'm not sure how valuable it is?
>>
>> The original bug/issue should be caught during IR merging instead - and since the goal is to support the case of member functions in enums, it's not like the LLVM codegen can't handle this case (when it's C++ or any other language).
>>
>> (I assume the verifier check was added originally because members in enums broke LLVM in some way? But that bug has been/is being fixed so Rust keeps working? Or did it never break LLVM but instead just produce "weird" DWARF?)
>
> It didn't break LLVM, just the debug IR does not make sense for C++. I was suggesting the "CurrentSourceLang" method so there is no need to think about if the issue may happen in any other way than IR merging. IMHO, it is valuable than losing a few lines of code. Since it is cheap enough to keep and maintain, I'd prefer to keep the check.

I guess the counterargument might be that there's probably lots of invariants for what constitutes valid/reasonable DWARF for C++ - but we don't comprehensively try to check for all those things, why would we check for this thing in particular?

Generally the IR verifier is more about: "If the IR is verified it won't crash LLVM/will produce valid DWARF"


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115353



More information about the llvm-commits mailing list