I’m trying to use llvm/llc as a backend for my compiler, and I’m running into problems when I try to generate debug info for the code to make it debuggable.
Bascially, llc gives me a slew of errors:
!4 = !DILocation(line: 35, column: 8, scope: !5)
scope points into the type hierarchy
!25 = !DILocation(line: 38, column: 8, scope: !5)
scope points into the type hierarchy
!26 = !DILocation(line: 41, column: 8, scope: !5)
scope points into the type hierarchy
!27 = !DILocation(line: 30, column: 26, scope: !5)
scope points into the type hierarchy
warning: ignoring invalid debug info in foo.ll
It seems like it doesn’t like the scope reference, but !5
is just the DISubProgram for the function:
!5 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !0, file: !1, line: 28, type: !6, spFlags: 0, retainedNodes: !24)
What could be going wrong here? What does the error actually mean, as there is no type hierachy here at all — just a compilation unit, a function, and some line numbers.