[llvm] r234021 - Verifier: Check that inlined-at locations agree

Duncan P. N. Exon Smith dexonsmith at apple.com
Fri Apr 3 11:09:05 PDT 2015


> On 2015-Apr-03, at 10:24, David Blaikie <dblaikie at gmail.com> wrote:
> 
> 
> 
> On Fri, Apr 3, 2015 at 9:54 AM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> Author: dexonsmith
> Date: Fri Apr  3 11:54:30 2015
> New Revision: 234021
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=234021&view=rev
> Log:
> 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.
> 
> This surprises me - you're saying the inlinedAt location on the local variable was wrong where the !dbg was right? (& the one we were relying on/using for output was, presumably, the inlinedAt on the local variable? the one that was wrong?)

Yup.  I was surprised too.  I figure we must have had a bug in the past
that got fixed.  But it's possible I got it wrong for one or two of the
testcases?

BTW, we now have a bot building LLVM with `-flto -g` (using an RA
stage1 compiler):

http://lab.llvm.org:8080/green/job/llvm-stage2-cmake-RgLTO_build/

This will build all the LLVM executables (opt/llc/llvm-as/etc.) with
LTO and full debug info.  I figure if the new checks fail anywhere they
should fail there :).  I may wait for it to pick up my verifier check
before pushing the backend assertions.

>  
>  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.
> 
> Modified:
>     llvm/trunk/lib/IR/Verifier.cpp
>     llvm/trunk/test/CodeGen/ARM/debug-info-d16-reg.ll
>     llvm/trunk/test/CodeGen/ARM/debug-info-s16-reg.ll
>     llvm/trunk/test/DebugInfo/2010-05-03-OriginDIE.ll
>     llvm/trunk/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll
>     llvm/trunk/test/DebugInfo/Mips/InlinedFnLocalVar.ll
>     llvm/trunk/test/DebugInfo/PR20038.ll
>     llvm/trunk/test/DebugInfo/X86/InlinedFnLocalVar.ll
>     llvm/trunk/test/DebugInfo/X86/dbg-value-inlined-parameter.ll
>     llvm/trunk/test/DebugInfo/X86/inline-member-function.ll
>     llvm/trunk/test/DebugInfo/X86/inline-seldag-test.ll
>     llvm/trunk/test/DebugInfo/cross-cu-inlining.ll
>     llvm/trunk/test/DebugInfo/inline-scopes.ll
>     llvm/trunk/test/DebugInfo/namespace_inline_function_definition.ll
>     llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
> 
> Modified: llvm/trunk/lib/IR/Verifier.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/lib/IR/Verifier.cpp (original)
> +++ llvm/trunk/lib/IR/Verifier.cpp Fri Apr  3 11:54:30 2015
> @@ -3372,6 +3372,20 @@ void Verifier::visitDbgIntrinsic(StringR
>    Assert(isa<MDExpression>(DII.getRawExpression()),
>           "invalid llvm.dbg." + Kind + " intrinsic expression", &DII,
>           DII.getRawExpression());
> +
> +  // Ignore broken !dbg attachments; they're checked elsewhere.
> +  if (MDNode *N = DII.getDebugLoc().getAsMDNode())
> +    if (!isa<MDLocation>(N))
> +      return;
> +
> +  // The inlined-at attachments for variables and !dbg attachments must agree.
> +  MDLocalVariable *Var = DII.getVariable();
> +  MDLocation *VarIA = Var->getInlinedAt();
> +  MDLocation *Loc = DII.getDebugLoc();
> +  MDLocation *LocIA = Loc ? Loc->getInlinedAt() : nullptr;
> +  BasicBlock *BB = DII.getParent();
> +  Assert(VarIA == LocIA, "mismatched variable and !dbg inlined-at", &DII, BB,
> +         BB ? BB->getParent() : nullptr, Var, VarIA, Loc, LocIA);
>  }
> 
>  void Verifier::visitUnresolvedTypeRef(const MDString *S, const MDNode *N) {
> 
> Modified: llvm/trunk/test/CodeGen/ARM/debug-info-d16-reg.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/debug-info-d16-reg.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/ARM/debug-info-d16-reg.ll (original)
> +++ llvm/trunk/test/CodeGen/ARM/debug-info-d16-reg.ll Fri Apr  3 11:54:30 2015
> @@ -45,9 +45,9 @@ entry:
>    %3 = getelementptr inbounds i8, i8* bitcast (i32 (i32, i8**)* @main to i8*), i32 %argc, !dbg !37
>    %4 = trunc i32 %argc to i8, !dbg !37
>    %5 = add i8 %4, 97, !dbg !37
> -  tail call void @llvm.dbg.value(metadata i8* %3, i64 0, metadata !19, metadata !MDExpression()) nounwind, !dbg !38
> -  tail call void @llvm.dbg.value(metadata double %1, i64 0, metadata !20, metadata !MDExpression()) nounwind, !dbg !38
> -  tail call void @llvm.dbg.value(metadata i8 %5, i64 0, metadata !21, metadata !MDExpression()) nounwind, !dbg !38
> +  tail call void @llvm.dbg.value(metadata i8* %3, i64 0, metadata !49, metadata !MDExpression()) nounwind, !dbg !38
> +  tail call void @llvm.dbg.value(metadata double %1, i64 0, metadata !50, metadata !MDExpression()) nounwind, !dbg !38
> +  tail call void @llvm.dbg.value(metadata i8 %5, i64 0, metadata !51, metadata !MDExpression()) nounwind, !dbg !38
>    %6 = zext i8 %5 to i32, !dbg !39
>    %7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* %3, double %1, i32 %6) nounwind, !dbg !39
>    %8 = tail call i32 @printer(i8* %3, double %1, i8 zeroext %5) nounwind, !dbg !40
> @@ -75,12 +75,17 @@ declare i32 @puts(i8* nocapture) nounwin
>  !13 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !46, scope: !1, baseType: !14)
>  !14 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !46, scope: !1, baseType: !15)
>  !15 = !MDBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
> -!16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "ptr", line: 11, arg: 0, scope: !0, file: !1, type: !6)
> -!17 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "val", line: 11, arg: 0, scope: !0, file: !1, type: !7)
> -!18 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 11, arg: 0, scope: !0, file: !1, type: !8)
> -!19 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "ptr", line: 4, arg: 0, scope: !9, file: !1, type: !6)
> -!20 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "val", line: 4, arg: 0, scope: !9, file: !1, type: !7)
> -!21 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 4, arg: 0, scope: !9, file: !1, type: !8)
> +!16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "ptr", line: 11, arg: 1, scope: !0, file: !1, type: !6)
> +!17 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "val", line: 11, arg: 2, scope: !0, file: !1, type: !7)
> +!18 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 11, arg: 3, scope: !0, file: !1, type: !8)
> +!19 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "ptr", line: 4, arg: 1, scope: !9, file: !1, type: !6)
> +!20 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "val", line: 4, arg: 2, scope: !9, file: !1, type: !7)
> +!21 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 4, arg: 3, scope: !9, file: !1, type: !8)
> +
> +!49 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "ptr", line: 4, arg: 1, scope: !9, file: !1, type: !6, inlinedAt: !37)
> +!50 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "val", line: 4, arg: 2, scope: !9, file: !1, type: !7, inlinedAt: !37)
> +!51 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 4, arg: 2, scope: !9, file: !1, type: !8, inlinedAt: !37)
> +
>  !22 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 17, arg: 0, scope: !10, file: !1, type: !5)
>  !23 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 17, arg: 0, scope: !10, file: !1, type: !13)
>  !24 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "dval", line: 19, scope: !25, file: !1, type: !7)
> 
> Modified: llvm/trunk/test/CodeGen/ARM/debug-info-s16-reg.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/debug-info-s16-reg.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/ARM/debug-info-s16-reg.ll (original)
> +++ llvm/trunk/test/CodeGen/ARM/debug-info-s16-reg.ll Fri Apr  3 11:54:30 2015
> @@ -48,9 +48,9 @@ entry:
>    %add.ptr = getelementptr i8, i8* bitcast (i32 (i32, i8**)* @main to i8*), i32 %argc, !dbg !40
>    %add5 = add nsw i32 %argc, 97, !dbg !40
>    %conv6 = trunc i32 %add5 to i8, !dbg !40
> -  tail call void @llvm.dbg.value(metadata i8* %add.ptr, i64 0, metadata !8, metadata !MDExpression()) nounwind, !dbg !41
> -  tail call void @llvm.dbg.value(metadata float %conv1, i64 0, metadata !10, metadata !MDExpression()) nounwind, !dbg !42
> -  tail call void @llvm.dbg.value(metadata i8 %conv6, i64 0, metadata !12, metadata !MDExpression()) nounwind, !dbg !43
> +  tail call void @llvm.dbg.value(metadata i8* %add.ptr, i64 0, metadata !58, metadata !MDExpression()) nounwind, !dbg !41
> +  tail call void @llvm.dbg.value(metadata float %conv1, i64 0, metadata !60, metadata !MDExpression()) nounwind, !dbg !42
> +  tail call void @llvm.dbg.value(metadata i8 %conv6, i64 0, metadata !62, metadata !MDExpression()) nounwind, !dbg !43
>    %conv.i = fpext float %conv1 to double, !dbg !44
>    %conv3.i = and i32 %add5, 255, !dbg !44
>    %call.i = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* %add.ptr, double %conv.i, i32 %conv3.i) nounwind optsize, !dbg !44
> @@ -79,6 +79,11 @@ declare void @llvm.dbg.value(metadata, i
>  !11 = !MDBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
>  !12 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 4, arg: 3, scope: !0, file: !1, type: !13)
>  !13 = !MDBasicType(tag: DW_TAG_base_type, name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
> +
> +!58 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "ptr", line: 4, arg: 1, scope: !0, file: !1, type: !9, inlinedAt: !40)
> +!60 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "val", line: 4, arg: 2, scope: !0, file: !1, type: !11, inlinedAt: !40)
> +!62 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 4, arg: 3, scope: !0, file: !1, type: !13, inlinedAt: !40)
> +
>  !14 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "ptr", line: 11, arg: 1, scope: !6, file: !1, type: !9)
>  !15 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "val", line: 11, arg: 2, scope: !6, file: !1, type: !11)
>  !16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 11, arg: 3, scope: !6, file: !1, type: !13)
> 
> Modified: llvm/trunk/test/DebugInfo/2010-05-03-OriginDIE.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2010-05-03-OriginDIE.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/2010-05-03-OriginDIE.ll (original)
> +++ llvm/trunk/test/DebugInfo/2010-05-03-OriginDIE.ll Fri Apr  3 11:54:30 2015
> @@ -58,7 +58,7 @@ declare void @uuid_LtoB(i8*, i8*)
>  !5 = !MDSubroutineType(types: !6)
>  !6 = !{null}
>  !7 = !MDLocation(line: 810, scope: !1)
> -!8 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "data", line: 201, arg: 0, scope: !9, file: !10, type: !11)
> +!8 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "data", line: 201, arg: 0, scope: !9, file: !10, type: !11, inlinedAt: !7)
>  !9 = !MDSubprogram(name: "_OSSwapInt64", linkageName: "_OSSwapInt64", line: 202, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !10, scope: null, type: !5)
>  !10 = !MDFile(filename: "OSByteOrder.h", directory: "/usr/include/libkern/ppc")
>  !11 = !MDDerivedType(tag: DW_TAG_typedef, name: "uint64_t", line: 59, file: !36, scope: !3, baseType: !13)
> 
> Modified: llvm/trunk/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll (original)
> +++ llvm/trunk/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll Fri Apr  3 11:54:30 2015
> @@ -15,8 +15,8 @@ declare void @llvm.dbg.value(metadata, i
>  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 !59, metadata !MDExpression()), !dbg !19
> +  tail call void @llvm.dbg.declare(metadata !29, metadata !60, 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)
> +
> +!59 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5, inlinedAt: !17)
> +!60 = !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}
> 
> Modified: llvm/trunk/test/DebugInfo/Mips/InlinedFnLocalVar.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Mips/InlinedFnLocalVar.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/Mips/InlinedFnLocalVar.ll (original)
> +++ llvm/trunk/test/DebugInfo/Mips/InlinedFnLocalVar.ll Fri Apr  3 11:54:30 2015
> @@ -15,8 +15,8 @@ declare void @llvm.dbg.value(metadata, i
>  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 !59, metadata !MDExpression()), !dbg !19
> +  tail call void @llvm.dbg.declare(metadata !29, metadata !60, 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)
> +
> +!59 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5, inlinedAt: !17)
> +!60 = !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}
> 
> Modified: llvm/trunk/test/DebugInfo/PR20038.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/PR20038.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/PR20038.ll (original)
> +++ llvm/trunk/test/DebugInfo/PR20038.ll Fri Apr  3 11:54:30 2015
> @@ -74,10 +74,10 @@ land.end:
> 
>  cleanup.action:                                   ; preds = %land.end
>    store %struct.C* %agg.tmp.ensured, %struct.C** %this.addr.i, align 8, !dbg !22
> -  call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i, metadata !29, metadata !MDExpression()), !dbg !31
> +  call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i, metadata !129, metadata !MDExpression()), !dbg !31
>    %this1.i = load %struct.C*, %struct.C** %this.addr.i, !dbg !22
>    store %struct.C* %this1.i, %struct.C** %this.addr.i.i, align 8, !dbg !21
> -  call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i.i, metadata !32, metadata !MDExpression()), !dbg !33
> +  call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i.i, metadata !132, metadata !MDExpression()), !dbg !33
>    %this1.i.i = load %struct.C*, %struct.C** %this.addr.i.i, !dbg !21
>    br label %cleanup.done, !dbg !22
> 
> @@ -94,7 +94,7 @@ entry:
>    call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !29, metadata !MDExpression()), !dbg !38
>    %this1 = load %struct.C*, %struct.C** %this.addr
>    store %struct.C* %this1, %struct.C** %this.addr.i, align 8, !dbg !37
> -  call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i, metadata !32, metadata !MDExpression()), !dbg !39
> +  call void @llvm.dbg.declare(metadata %struct.C** %this.addr.i, metadata !232, metadata !MDExpression()), !dbg !39
>    %this1.i = load %struct.C*, %struct.C** %this.addr.i, !dbg !37
>    ret void, !dbg !37
>  }
> @@ -154,6 +154,11 @@ attributes #2 = { nounwind readnone }
>  !31 = !MDLocation(line: 0, scope: !17, inlinedAt: !22)
>  !32 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30)
>  !33 = !MDLocation(line: 0, scope: !16, inlinedAt: !21)
> +
> +!129 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !30, inlinedAt: !22)
> +!132 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30, inlinedAt: !21)
> +!232 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30, inlinedAt: !37)
> +
>  !34 = !MDLocation(line: 5, scope: !35)
>  !35 = distinct !MDLexicalBlock(line: 5, column: 0, file: !5, scope: !36)
>  !36 = distinct !MDLexicalBlock(line: 5, column: 0, file: !5, scope: !12)
> 
> Modified: llvm/trunk/test/DebugInfo/X86/InlinedFnLocalVar.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/InlinedFnLocalVar.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/X86/InlinedFnLocalVar.ll (original)
> +++ llvm/trunk/test/DebugInfo/X86/InlinedFnLocalVar.ll Fri Apr  3 11:54:30 2015
> @@ -15,8 +15,8 @@ declare void @llvm.dbg.value(metadata, i
>  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}
> 
> Modified: llvm/trunk/test/DebugInfo/X86/dbg-value-inlined-parameter.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/dbg-value-inlined-parameter.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/X86/dbg-value-inlined-parameter.ll (original)
> +++ llvm/trunk/test/DebugInfo/X86/dbg-value-inlined-parameter.ll Fri Apr  3 11:54:30 2015
> @@ -61,8 +61,8 @@ declare float* @bar(i32) optsize
> 
>  define void @foobar() nounwind optsize ssp {
>  entry:
> -  tail call void @llvm.dbg.value(metadata %struct.S1* @p, i64 0, metadata !9, metadata !MDExpression()) nounwind, !dbg !31
> -  tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !18, metadata !MDExpression()) nounwind, !dbg !35
> +  tail call void @llvm.dbg.value(metadata %struct.S1* @p, i64 0, metadata !109, metadata !MDExpression()) nounwind, !dbg !31
> +  tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !118, metadata !MDExpression()) nounwind, !dbg !35
>    store i32 1, i32* getelementptr inbounds (%struct.S1, %struct.S1* @p, i64 0, i32 1), align 8, !dbg !36
>    %call.i = tail call float* @bar(i32 1) nounwind optsize, !dbg !37
>    store float* %call.i, float** getelementptr inbounds (%struct.S1, %struct.S1* @p, i64 0, i32 0), align 8, !dbg !37
> @@ -83,7 +83,10 @@ declare void @llvm.dbg.value(metadata, i
>  !6 = !MDSubprogram(name: "foobar", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !1, scope: !1, type: !7, function: void ()* @foobar)
>  !7 = !MDSubroutineType(types: !8)
>  !8 = !{null}
> -!9 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "sp", line: 7, arg: 1, scope: !0, file: !1, type: !10, inlinedAt: !32)
> +!9 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "sp", line: 7, arg: 1, scope: !0, file: !1, type: !10)
> +
> +!109 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "sp", line: 7, arg: 1, scope: !0, file: !1, type: !10, inlinedAt: !32)
> +
>  !10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !2, baseType: !11)
>  !11 = !MDDerivedType(tag: DW_TAG_typedef, name: "S1", line: 4, file: !42, scope: !2, baseType: !12)
>  !12 = !MDCompositeType(tag: DW_TAG_structure_type, name: "S1", line: 1, size: 128, align: 64, file: !42, scope: !2, elements: !13)
> @@ -92,7 +95,10 @@ declare void @llvm.dbg.value(metadata, i
>  !15 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !2, baseType: !16)
>  !16 = !MDBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
>  !17 = !MDDerivedType(tag: DW_TAG_member, name: "nums", line: 3, size: 32, align: 32, offset: 64, file: !42, scope: !1, baseType: !5)
> -!18 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "nums", line: 7, arg: 2, scope: !0, file: !1, type: !5, inlinedAt: !32)
> +!18 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "nums", line: 7, arg: 2, scope: !0, file: !1, type: !5)
> +
> +!118 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "nums", line: 7, arg: 2, scope: !0, file: !1, type: !5, inlinedAt: !32)
> +
>  !19 = !MDGlobalVariable(name: "p", line: 14, isLocal: false, isDefinition: true, scope: !2, file: !1, type: !11, variable: %struct.S1* @p)
>  !20 = !MDLocation(line: 7, column: 13, scope: !0)
>  !21 = !MDLocation(line: 7, column: 21, scope: !0)
> 
> Modified: llvm/trunk/test/DebugInfo/X86/inline-member-function.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/inline-member-function.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/X86/inline-member-function.ll (original)
> +++ llvm/trunk/test/DebugInfo/X86/inline-member-function.ll Fri Apr  3 11:54:30 2015
> @@ -88,8 +88,8 @@ attributes #1 = { nounwind readnone }
>  !21 = !{i32 1, !"Debug Info Version", i32 3}
>  !22 = !{!"clang version 3.5.0 "}
>  !23 = !MDLocation(line: 8, scope: !13)
> -!24 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !25)
> +!24 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !25, inlinedAt: !23)
>  !25 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS3foo")
>  !26 = !MDLocation(line: 0, scope: !17, inlinedAt: !23)
> -!27 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 2, arg: 2, scope: !17, file: !14, type: !9)
> +!27 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 2, arg: 2, scope: !17, file: !14, type: !9, inlinedAt: !23)
>  !28 = !MDLocation(line: 2, scope: !17, inlinedAt: !23)
> 
> Modified: llvm/trunk/test/DebugInfo/X86/inline-seldag-test.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/inline-seldag-test.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/X86/inline-seldag-test.ll (original)
> +++ llvm/trunk/test/DebugInfo/X86/inline-seldag-test.ll Fri Apr  3 11:54:30 2015
> @@ -67,7 +67,7 @@ attributes #1 = { nounwind readnone }
>  !16 = !MDDerivedType(tag: DW_TAG_volatile_type, baseType: !11)
>  !17 = !MDLocation(line: 5, scope: !4)
>  !18 = !MDLocation(line: 6, column: 7, scope: !4)
> -!19 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 1, arg: 1, scope: !8, file: !5, type: !11)
> +!19 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 1, arg: 1, scope: !8, file: !5, type: !11, inlinedAt: !18)
>  !20 = !MDLocation(line: 1, scope: !8, inlinedAt: !18)
>  !21 = !MDLocation(line: 2, scope: !8, inlinedAt: !18)
>  !22 = !MDLocation(line: 7, scope: !4)
> 
> Modified: llvm/trunk/test/DebugInfo/cross-cu-inlining.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/cross-cu-inlining.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/cross-cu-inlining.ll (original)
> +++ llvm/trunk/test/DebugInfo/cross-cu-inlining.ll Fri Apr  3 11:54:30 2015
> @@ -75,7 +75,7 @@ entry:
>    %1 = bitcast i32* %x.addr.i to i8*
>    call void @llvm.lifetime.start(i64 4, i8* %1)
>    store i32 %0, i32* %x.addr.i, align 4
> -  call void @llvm.dbg.declare(metadata i32* %x.addr.i, metadata !20, metadata !MDExpression()), !dbg !21
> +  call void @llvm.dbg.declare(metadata i32* %x.addr.i, metadata !120, metadata !MDExpression()), !dbg !21
>    %2 = load i32, i32* %x.addr.i, align 4, !dbg !22
>    %mul.i = mul nsw i32 %2, 2, !dbg !22
>    %3 = bitcast i32* %x.addr.i to i8*, !dbg !22
> @@ -133,6 +133,9 @@ attributes #3 = { nounwind }
>  !18 = !{!"clang version 3.5.0 "}
>  !19 = !MDLocation(line: 4, scope: !4)
>  !20 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 1, arg: 1, scope: !12, file: !13, type: !8)
> +
> +!120 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 1, arg: 1, scope: !12, file: !13, type: !8, inlinedAt: !19)
> +
>  !21 = !MDLocation(line: 1, scope: !12, inlinedAt: !19)
>  !22 = !MDLocation(line: 2, scope: !12, inlinedAt: !19)
>  !23 = !MDLocation(line: 1, scope: !12)
> 
> Modified: llvm/trunk/test/DebugInfo/inline-scopes.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/inline-scopes.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/inline-scopes.ll (original)
> +++ llvm/trunk/test/DebugInfo/inline-scopes.ll Fri Apr  3 11:54:30 2015
> @@ -111,7 +111,7 @@ attributes #2 = { "less-precise-fpmad"="
>  !13 = !{i32 2, !"Dwarf Version", i32 4}
>  !14 = !{i32 1, !"Debug Info Version", i32 3}
>  !15 = !{!"clang version 3.5.0 "}
> -!16 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 3, scope: !17, file: !11, type: !18)
> +!16 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 3, scope: !17, file: !11, type: !18, inlinedAt: !20)
>  !17 = distinct !MDLexicalBlock(line: 3, column: 0, file: !1, scope: !12)
>  !18 = !MDBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean)
>  !19 = !MDLocation(line: 3, scope: !17, inlinedAt: !20)
> @@ -119,7 +119,7 @@ attributes #2 = { "less-precise-fpmad"="
>  !21 = !MDLocation(line: 4, scope: !17, inlinedAt: !20)
>  !22 = !MDLocation(line: 5, scope: !12, inlinedAt: !20)
>  !23 = !MDLocation(line: 6, scope: !12, inlinedAt: !20)
> -!24 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 2, scope: !25, file: !6, type: !18)
> +!24 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 2, scope: !25, file: !6, type: !18, inlinedAt: !28)
>  !25 = distinct !MDLexicalBlock(line: 2, column: 0, file: !5, scope: !26)
>  !26 = !MDLexicalBlockFile(discriminator: 0, file: !5, scope: !10)
>  !27 = !MDLocation(line: 2, scope: !25, inlinedAt: !28)
> 
> Modified: llvm/trunk/test/DebugInfo/namespace_inline_function_definition.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/namespace_inline_function_definition.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/namespace_inline_function_definition.ll (original)
> +++ llvm/trunk/test/DebugInfo/namespace_inline_function_definition.ll Fri Apr  3 11:54:30 2015
> @@ -42,7 +42,7 @@ entry:
>    store i32 0, i32* %retval
>    %0 = load i32, i32* @x, align 4, !dbg !16
>    store i32 %0, i32* %i.addr.i, align 4
> -  call void @llvm.dbg.declare(metadata i32* %i.addr.i, metadata !17, metadata !MDExpression()), !dbg !18
> +  call void @llvm.dbg.declare(metadata i32* %i.addr.i, metadata !117, metadata !MDExpression()), !dbg !18
>    %1 = load i32, i32* %i.addr.i, align 4, !dbg !18
>    %mul.i = mul nsw i32 %1, 2, !dbg !18
>    ret i32 %mul.i, !dbg !16
> @@ -88,5 +88,8 @@ attributes #2 = { nounwind readnone }
>  !15 = !{!"clang version 3.5.0 "}
>  !16 = !MDLocation(line: 5, scope: !4)
>  !17 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 6, arg: 1, scope: !9, file: !5, type: !8)
> +
> +!117 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 6, arg: 1, scope: !9, file: !5, type: !8, inlinedAt: !16)
> +
>  !18 = !MDLocation(line: 6, scope: !9, inlinedAt: !16)
>  !19 = !MDLocation(line: 6, scope: !9)
> 
> Modified: llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll?rev=234021&r1=234020&r2=234021&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll (original)
> +++ llvm/trunk/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll Fri Apr  3 11:54:30 2015
> @@ -41,15 +41,15 @@ return:
>  !6 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
>  !7 = !MDLocation(line: 8, scope: !1)
>  !8 = !MDLocation(line: 9, scope: !1)
> -!9 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 4, arg: 0, scope: !10, file: !2, type: !6)
> +!9 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 4, arg: 0, scope: !10, file: !2, type: !6, inlinedAt: !8)
>  !10 = !MDSubprogram(name: "bar", linkageName: "bar", line: 4, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !20, scope: !2, type: !11)
>  !11 = !MDSubroutineType(types: !12)
>  !12 = !{null, !6, !13, !14}
>  !13 = !MDBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed)
>  !14 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !20, scope: !2, baseType: null)
>  !15 = !MDLocation(line: 4, scope: !10, inlinedAt: !8)
> -!16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 4, arg: 0, scope: !10, file: !2, type: !13)
> -!17 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "z", line: 4, arg: 0, scope: !10, file: !2, type: !14)
> +!16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 4, arg: 0, scope: !10, file: !2, type: !13, inlinedAt: !8)
> +!17 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "z", line: 4, arg: 0, scope: !10, file: !2, type: !14, inlinedAt: !8)
>  !18 = !MDLocation(line: 5, scope: !10, inlinedAt: !8)
>  !19 = !MDLocation(line: 10, scope: !1)
>  !20 = !MDFile(filename: "bar.c", directory: "/tmp/")
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list