diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-03 16:54:30 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-03 16:54:30 +0000 |
commit | 81f522a62e885ef1e947a2d5c4c202df3d1b3f70 (patch) | |
tree | 19ae0575f3d18f617622b065632e9e4d39e0cacf /llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll | |
parent | 7b0c62e6858d7764bf72d9e6f0f1fdf0157283d7 (diff) | |
download | bcm5719-llvm-81f522a62e885ef1e947a2d5c4c202df3d1b3f70.tar.gz bcm5719-llvm-81f522a62e885ef1e947a2d5c4c202df3d1b3f70.zip |
Verifier: Check that inlined-at locations agree
Check that the `MDLocalVariable::getInlinedAt()` in a debug info
intrinsic's variable always matches the `MDLocation::getInlinedAt()` of
its `!dbg` attachment.
The goal here is to get rid of `MDLocalVariable::getInlinedAt()`
entirely (PR22778), since it's expensive and unnecessary, but I'll let
this verifier check bake for a while (a week maybe?) first. I've
updated the testcases that had the wrong value for `inlinedAt:`.
This checks that things are sane in the IR, but currently things go out
of whack in a few places in the backend. I'll follow shortly with
assertions in the backend (with code fixes).
If you have out-of-tree testcases that just started failing, here's how
I updated these ones:
1. The verifier check gives you the basic block, function, instruction,
and relevant metadata arguments (metadata numbering doesn't
necessarily match the source file, unfortunately).
2. Look at the `@llvm.dbg.*()` instruction, and compare the
`inlinedAt:` fields of the variable argument (second `metadata`
argument) and the `!dbg` attachment.
3. Figure out based on the variable `scope:` chain and the functions in
the file whether the variable has been inlined (and into what), so
you can determine which `inlinedAt:` is actually correct. In all of
the in-tree testcases, the `!MDLocation()` was correct and the
`!MDLocalVariable()` was wrong, but YMMV.
4. Duplicate the metadata that you're going to change, and add/drop the
`inlinedAt:` field from one of them. Be careful that the other
references to the same metadata node point at the correct one.
llvm-svn: 234021
Diffstat (limited to 'llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll')
-rw-r--r-- | llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll b/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll index c5be61f78f8..223daadfd77 100644 --- a/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll +++ b/llvm/test/DebugInfo/X86/InlinedFnLocalVar.ll @@ -15,8 +15,8 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon define i32 @bar() nounwind ssp { entry: %0 = load i32, i32* @i, align 4, !dbg !17 ; <i32> [#uses=2] - tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !9, metadata !MDExpression()), !dbg !19 - tail call void @llvm.dbg.declare(metadata !29, metadata !10, metadata !MDExpression()), !dbg !21 + tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !109, metadata !MDExpression()), !dbg !19 + tail call void @llvm.dbg.declare(metadata !29, metadata !110, metadata !MDExpression()), !dbg !21 %1 = mul nsw i32 %0, %0, !dbg !22 ; <i32> [#uses=2] store i32 %1, i32* @i, align 4, !dbg !17 ret i32 %1, !dbg !23 @@ -36,6 +36,10 @@ entry: !8 = !{!5} !9 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5) !10 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 10, scope: !11, file: !1, type: !12) + +!109 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5, inlinedAt: !17) +!110 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 10, scope: !11, file: !1, type: !12, inlinedAt: !17) + !11 = distinct !MDLexicalBlock(line: 9, column: 0, file: !1, scope: !0) !12 = !MDCompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13) !13 = !{!14, !15} |