[PATCH] D152095: [Verifier] definition subprograms cannot be nested within DICompositeType when enabling ODR.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 15:19:53 PDT 2023


dblaikie added a comment.

In D152095#4413788 <https://reviews.llvm.org/D152095#4413788>, @DianQK wrote:

> What I would like to ask is about the checks related to inlined subroutines in the issue. How are they different from the checks for definition subprograms? Based on your previous explanation and my current understanding, it seems that checking `DISubprogram` should be sufficient.
>
>> In the current context, I think I can understand that "subroutine" and "subprogram" are the same term/semantics.

Ah, sorry - yeah, I might've used "subroutine" and "subprogram" somewhat casually/interchangeably in my descriptions. It's weird those things are named differently in the DWARF spec anyway, but...

The basic idea is that if a member function is defined inside the type, we can't properly reflect that if the type is in another CU - so for cross-CU/LTO purposes, all member functions need to be indirected through a declaration in the type and otherwise scoped to something that can appear outside the type definition - like to the root or to a namespace, that can be duplicated/produced in whatever CU is required for the definition of the function.


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