
By chance, two things have prevented the autoupgrade path being exercised much so far: * LLParser setting the debug-info mode to "old" on seeing intrinsics, * The test in AutoUpgrade.cpp wanting to upgrade into a "new" debug-info block. In practice, this appears to mean this code path hasn't seen the various invalid inputs that can come its way. This commit does a number of things: * Tolerates the various illegal inputs that can be written with debug-intrinsics, and that must be tolerated until the Verifier runs, * Printing illegal/null DbgRecord fields must succeed, * Verifier errors need to localise the function/block where the error is, * Tests that now see debug records will print debug-record errors, Plus a few new tests for other intrinsic-to-debug-record failures modes I found. There are also two edge cases: * Some of the unit tests switch back and forth between intrinsic and record modes at will; I've deleted coverage and some assertions to tolerate this as intrinsic support is now Gone (TM), * In sroa-extract-bits.ll, the order of debug records flips. This is because the autoupgrader upgrades in the opposite order to the basic block conversion routines... which doesn't change the record order, but _does_ change the use list order in Metadata! This should (TM) have no consequence to the correctness of LLVM, but will change the order of various records and the order of DWARF record output too. I tried to reduce this patch to a smaller collection of changes, but they're all intertwined, sorry.
18 lines
526 B
LLVM
18 lines
526 B
LLVM
; RUN: llvm-as -disable-output <%s 2>&1 | FileCheck %s
|
|
; CHECK: invalid #dbg record variable
|
|
; CHECK-NEXT: #dbg_value({{.*}})
|
|
; CHECK: warning: ignoring invalid debug info
|
|
|
|
define void @foo(i32 %a) {
|
|
entry:
|
|
%s = alloca i32
|
|
call void @llvm.dbg.value(metadata ptr %s, i64 0, metadata !"", metadata !DIExpression()), !dbg !DILocation(scope: !1)
|
|
ret void
|
|
}
|
|
|
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
|
|
|
|
!llvm.module.flags = !{!0}
|
|
!0 = !{i32 2, !"Debug Info Version", i32 3}
|
|
!1 = distinct !DISubprogram()
|