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

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 14:45:12 PDT 2016


pcc added inline comments.

================
Comment at: lib/IR/DIBuilder.cpp:698-699
@@ -697,4 +697,4 @@
                     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());
 
----------------
dblaikie wrote:
> Should we just make the IR writer conditional on virtuality, then? seems oddly inconsistent this way?
I don't have a strong opinion on the matter, but I'd normally favour simplicity in the IR writer. But since the bitcode writer writes out these virtual indices (even for non-virtual functions) in VBR format and -1u has a longer representation than 0, I think that tips the scales in favour of using 0 here and adding the conditional to the IR writer. I'll do that then.


http://reviews.llvm.org/D18236





More information about the llvm-commits mailing list