[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
Tue Jun 27 06:10:53 PDT 2023


DianQK added a comment.

The modifications made this time still involve manually adding declaration references. I just wanted to demonstrate that these test cases work after removing the previous code and adding the declaration. I can remove these two test cases in the next commit or remove them in this current commit.



================
Comment at: llvm/test/DebugInfo/Generic/cross-cu-inlining-ranges.ll:50
 !9 = !DILocation(line: 0, scope: !10, inlinedAt: !13)
-!10 = distinct !DISubprogram(name: "init", scope: !12, file: !11, type: !7, spFlags: DISPFlagDefinition, unit: !0)
+!10 = distinct !DISubprogram(name: "init", scope: !12, file: !11, type: !7, spFlags: DISPFlagDefinition, unit: !0, declaration: !22)
 !11 = !DIFile(filename: "<compiler-generated>", directory: "")
----------------
dblaikie wrote:
> This looks a bit confused - it's claiming to be a definition, but it's not referenced by any llvm Function - and then it's referencing a declaration? Perhaps these functions should not have the definition flag?
> 
> @aprantl @JDevlieghere what's the Swift IR look like today? Does it put subprogram definitions within composite types? That's not ideal/bit likely to break under LTO builds & would you be amenable to changing that to indirect through a definition that's outside the composite type to a declaration in the composite type?
I deleted this piece of code earlier in order to create the smallest possible test cases. 

In the https://swift.godbolt.org/z/7Yoqa7qnx, the `init` method does exist.
>From the provided link, the swiftc still puts subprogram definitions within composite types.


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