[PATCH] D152095: [Verifier] definition subprograms cannot be nested within DICompositeType when enabling ODR.
DianQK via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 7 07:46:23 PDT 2023
DianQK added a comment.
In D152095#4474741 <https://reviews.llvm.org/D152095#4474741>, @dblaikie wrote:
> I'm still not quite following why this patch has changes to `llvm/lib/CodeGen/AsmPrinter`? Is the point that those changes can be removed once this invariant is introduced? If so, those changes should probably be in a follow-up after this one, rather than at the same time.
I have removed these changes. I could push these changes directly after the current patch. If a review is still required, please let me know.
>>> I'd expect this change to add the verifier check, and add an example IR that doesn't pass verification/demonstrates the new verifier check correctly catches the intended case(s).
>>
>> This should be `llvm/test/Verifier/disubprogram-declaration-within-struct.ll`?
>
> Yep, that looks OK. Though I don't understand the phrasing "when enabling ODR" - what does that refer to? (is there some feature to "enable/disable ODR" that's relevant here?)
We can disable ODR with `disableDebugTypeODRUniquing`, or with the command line parameter `--disable-debug-info-type-map`.
When ODR is disabled or DICompositeType without an identifier, llvm-link will create two DICompositeType in different CU. In this case, LTO works fine.
> The explanation I found from ODR in LangRef <https://llvm.org/docs/LangRef.html#dicompositetype> is the One Definition Rule.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152095/new/
https://reviews.llvm.org/D152095
More information about the llvm-commits
mailing list