[llvm-dev] Should it be legal for two functions to have the same !dbg attachment?

Eric Christopher via llvm-dev llvm-dev at lists.llvm.org
Thu May 4 12:09:59 PDT 2017


>
>
> tl;dr: Basically, when invoking CloneFunctionInto on:
>
>   define void @f() !dbg !3 {
>     ret void, !dbg !4
>   }
>
>   define void @f_clone()
>
>   !llvm.dbg.cu = !{!1}
>   !1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2)
>   !2 = !DIFile(filename: "t.c", directory: "/path/to/dir")
>   !3 = distinct !DISubprogram(name: "foo", scope: !1, file: !2, unit: !1)
>   !4 = !DILocation(line: 1, scope: !3)
>
> I would like the result to be:
>
>   define void @f() !dbg !3 {
>     ret void, !dbg !4
>   }
>
>   define void @f_clone() !dbg !5 {
>     ret void, !dbg !6
>   }
>   !llvm.dbg.cu = !{!1}
>   !1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2)
>   !2 = !DIFile(filename: "t.c", directory: "/path/to/dir")
>   !3 = distinct !DISubprogram(name: "foo", scope: !1, file: !2, unit: !1)
>   !4 = !DILocation(line: 1, scope: !3)
>   !5 = distinct !DISubprogram(name: "foo", scope: !1, file: !2, unit: !1)
>   !6 = !DILocation(line: 1, scope: !5)
>
> Thoughts?
>
>
Seems reasonable to me.

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170504/ffdc4f62/attachment.html>


More information about the llvm-dev mailing list