[PATCH] D18236: DebugInfo: Add ability to not emit DW_AT_vtable_elem_location for virtual functions.

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 11:26:19 PDT 2016


> On 2016-Mar-17, at 10:47, David Blaikie <dblaikie at gmail.com> wrote:
> 
> dblaikie added inline comments.
> 
> ================
> Comment at: lib/IR/DIBuilder.cpp:698
> @@ -697,3 +697,3 @@
>                     LinkageName, File, LineNo, Ty, isLocalToUnit, isDefinition,
> -                    ScopeLine, nullptr, 0, 0, Flags, isOptimized, TParams, Decl,
> -                    MDTuple::getTemporary(VMContext, None).release());
> +                    ScopeLine, nullptr, 0, -1u, Flags, isOptimized, TParams,
> +                    Decl, MDTuple::getTemporary(VMContext, None).release());
> ----------------
> Is zero not sufficient in this spot (& the other below) - since we still have it conditional on virtuality anyway?
> 
> ================
> Comment at: test/Assembler/disubprogram.ll:34
> @@ -33,3 +33,3 @@
> 
> -!10 = !{i32 1, !"Debug Info Version", i32 3}
> -!llvm.module.flags = !{!10}
> +; CHECK: !10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, isLocal: true, isDefinition: true, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: true, templateParams: !5, declaration: !8, variables: !6)
> +!10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,
> ----------------
> What's this test testing? I can't quite see what's new/unique/interesting about it.

Judicious use of `CHECK-SAME: , ...` will let you cherry-pick the
interesting fields.

> 
> ================
> Comment at: test/DebugInfo/Generic/virtual-index.ll:46
> @@ +45,3 @@
> +
> +; CHECK: DW_TAG_subprogram [
> +; CHECK: DW_AT_vtable_elem_location [DW_FORM_exprloc]  (<0x2> 10 00 )
> ----------------
> Given the verbosity of the IR, we usually put all the CHECK lines up above the IR (& include the C++ source that the IR is derived/generate from for illustrative purposes in a comment above the CHECK lines)
> 
> 
> http://reviews.llvm.org/D18236
> 
> 
> 



More information about the llvm-commits mailing list