[lld] [lld][WebAssembly] Return 0 for synthetic function offsets (PR #96134)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 00:37:45 PDT 2024


================
@@ -0,0 +1,31 @@
+target triple = "wasm32-unknown-emscripten"
+
+define void @foo(i32 %a, i32 %b) !dbg !6 {
+  ret void
+}
+
+define void @test1() !dbg !10 {
+entry:
+  call void @foo(i32 4, i32 5), !dbg !13
+  ret void, !dbg !14
+}
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!2, !3, !4}
+!llvm.ident = !{!5}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 19.0.0git", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
+!1 = !DIFile(filename: "b.c", directory: "")
+!2 = !{i32 7, !"Dwarf Version", i32 4}
+!3 = !{i32 2, !"Debug Info Version", i32 3}
+!4 = !{i32 1, !"wchar_size", i32 4}
+!5 = !{!"clang version 19.0.0git"}
+!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !7, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)
+!7 = !DISubroutineType(types: !8)
+!8 = !{null, !9, !9}
+!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!10 = distinct !DISubprogram(name: "test1", scope: !1, file: !1, line: 7, type: !11, scopeLine: 7, spFlags: DISPFlagDefinition, unit: !0)
+!11 = !DISubroutineType(types: !12)
+!12 = !{null}
+!13 = !DILocation(line: 8, column: 3, scope: !10)
+!14 = !DILocation(line: 9, column: 1, scope: !10)
----------------
aheejin wrote:

Converting these files to .s files generated this, which is too verbose: https://github.com/llvm/llvm-project/pull/96134/commits/6f7d8cd358c1ab130f4ed25740b64e8bb26561f4

So I just rewrote them just enough to reproduce the error: https://github.com/llvm/llvm-project/pull/96134/commits/607b92ab4c01dce8a50d18ce44bbabef0baf610f
(Turns out just mentioning the function name in `.debug_info` section was sufficient to reproduce the error)

https://github.com/llvm/llvm-project/pull/96134


More information about the llvm-commits mailing list