[PATCH] D89817: [DebugInfo] Expose Fortran array debug info attributes through DIBuilder.

Chih-Ping Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 10:49:52 PDT 2020


cchen15 added a comment.

In D89817#2347933 <https://reviews.llvm.org/D89817#2347933>, @aprantl wrote:

>> These can be DIExpression, ConstantAsMetadata, etc, so Metadata looks to be the right specificity (and the underlying 'get' function it calls types them as Metadata too).
>
> Why do we need to accept both DIExpression and ConstantAsMetadata? Since we can also represent all constants as DIExpression, I think I would prefer to have only one way to represent a constant. Would it be feasible to expect clients to pass constants as DIExpression(DW_OP_constu, <number>, DW_OP_stack_value)? And if it doesn't already exist perhaps add a `DIExpression *DIBuilder::createConstantExpression(unsigned value)` API?

We can do that, but then the debugger would need to work a bit harder in order to get a constant, doesn't it? I don't feel strongly either way. If you do want it done the way you prefer, please let me know and I will make the change.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89817/new/

https://reviews.llvm.org/D89817



More information about the llvm-commits mailing list