llvm.org GIT mirror llvm / 85d2ac2
[LoopUtils] Use i32 instead of `void`. The actual type of the first argument of the @dbg intrinsic doesn't really matter as we're setting it to `undef`, but the bitcode reader is picky about `void` types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349069 91177308-0d34-0410-b5e6-96231b3b80d8 Davide Italiano 9 months ago
3 changed file(s) with 33 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
614614 DIBuilder DIB(*ExitBlock->getModule());
615615 for (auto *DVI : DeadDebugInst)
616616 DIB.insertDbgValueIntrinsic(
617 UndefValue::get(DVI->getType()), DVI->getVariable(),
617 UndefValue::get(Builder.getInt32Ty()), DVI->getVariable(),
618618 DVI->getExpression(), DVI->getDebugLoc(), ExitBlock->getFirstNonPHI());
619619
620620 // Remove the block from the reference counting scheme, so that we can
0 ; Make sure we don't crash when writing bitcode.
1 ; RUN: opt -loop-deletion -o /dev/null
2
3 define void @f() {
4 br label %bb1
5
6 bb1: ; preds = %bb1, %0
7 call void @llvm.dbg.value(metadata i16 undef, metadata !1, metadata !DIExpression()), !dbg !11
8 br i1 undef, label %bb1, label %bb3
9
10 bb3: ; preds = %bb1
11 ret void
12 }
13
14 declare void @llvm.dbg.value(metadata, metadata, metadata)
15
16 !llvm.dbg.cu = !{!9}
17 !llvm.module.flags = !{!0}
18
19 !0 = !{i32 2, !"Debug Info Version", i32 3}
20 !1 = !DILocalVariable(name: "i", scope: !2, file: !3, line: 31, type: !7)
21 !2 = distinct !DILexicalBlock(scope: !4, file: !3, line: 31, column: 9)
22 !3 = !DIFile(filename: "foo.c", directory: "/bar")
23 !4 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 26, type: !5, scopeLine: 27, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !9, retainedNodes: !10)
24 !5 = !DISubroutineType(types: !6)
25 !6 = !{!7, !8, !7}
26 !7 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed)
27 !8 = !DIBasicType(size: 16, encoding: DW_ATE_signed)
28 !9 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "My Compiler", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !10, retainedTypes: !10, globals: !10)
29 !10 = !{}
30 !11 = !DILocation(line: 31, column: 13, scope: !2)
1717 %exitcond = icmp ne i32 %inc, 3, !dbg !23
1818 br i1 %exitcond, label %for.cond, label %for.end, !dbg !24, !llvm.loop !25
1919
20 ; CHECK: call void @llvm.dbg.value(metadata void undef, metadata !16, metadata !DIExpression()), !dbg !17
20 ; CHECK: call void @llvm.dbg.value(metadata i32 undef, metadata !16, metadata !DIExpression()), !dbg !17
2121 ; CHECK-NEXT: %call = tail call i32 {{.*}} @patatino()
2222 for.end: ; preds = %for.cond
2323 %call = tail call i32 (...) @patatino() #3, !dbg !27