
This patch adds support for parsing the proposed non-instruction debug info ("RemoveDIs") from textual IR, and adds a test for the parser as well as a set of verifier tests that are dependent on parsing to fire. An important detail of this patch is the fact that although we can now parse in the RemoveDIs (new) and Intrinsic (old) debug info formats, we will always convert back to the old format at the end of parsing - this is done for two reasons: firstly to ensure that every tool is able to process IR printed in the new format, regardless of whether that tool has had RemoveDIs support added, and secondly to maintain the effect of the existing flags: for the tools where support for the new format has been added, we will run LLVM passes in the new format iff `--try-experimental-debuginfo-iterators=true`, and we will print in the new format iff `--write-experimental-debuginfo-iterators=true`; the format of the textual IR input should have no effect on either of these features.
18 lines
432 B
LLVM
18 lines
432 B
LLVM
; RUN: llvm-as -disable-output <%s 2>&1 | FileCheck %s
|
|
; CHECK: invalid #dbg record variable
|
|
; CHECK-NEXT: #dbg_declare({{.*}})
|
|
; CHECK-NEXT: !{}
|
|
; CHECK: warning: ignoring invalid debug info
|
|
|
|
define void @foo(i32 %a) {
|
|
entry:
|
|
%s = alloca i32
|
|
#dbg_declare(ptr %s, !{}, !DIExpression(), !DILocation(scope: !1))
|
|
ret void
|
|
}
|
|
|
|
|
|
!llvm.module.flags = !{!0}
|
|
!0 = !{i32 2, !"Debug Info Version", i32 3}
|
|
!1 = distinct !DISubprogram()
|