[PATCH] D20147: [WIP] DebugInfo: New metadata representation for global variables.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 10:19:16 PDT 2016


pcc added a comment.

> Instead of baking a byte-offset into the IR, I was more thinking of using the DIExpression to describe the offset:


I suppose we could do that, but I reckon that would make things more complicated:

- each constant would need two DIExpressions, one for the case where a global exists and an address can be derived from the attached GlobalVariable's address, and one for the case where the global has been optimized away (where we'd use DW_OP_stack_value to describe the constant)
- it would add complexity to the `copyMetadata` function, as it would need to be able to manipulate and rewrite DIExpressions
- I also plan to use the offset in other kinds of metadata attached to globals, such as the type metadata for CFI and vtable opt. If we use a separate representation for each kind of metadata, `copyMetadata` would need to know how to adjust the offset in each kind of metadata


http://reviews.llvm.org/D20147





More information about the llvm-commits mailing list