[PATCH] D92013: [DebugInfo] Don't use DW_OP_implicit_value for fragments

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 15:28:46 PST 2020


aprantl added a comment.

In D92013#2413734 <https://reviews.llvm.org/D92013#2413734>, @labath wrote:

> I'd like to also fix this in a more fundamental way, but I think I'd need some guidance from someone more familiar with this code (who would that be?).
>
> One idea I had is to add something like `isPureFragment()` to the `DIExpression` class, which would return true if the expression consistent solely of a single DW_OP_LLVM_fragment operand.

You mean  `DIExpression(DW_OP_LLVM_fragment 0, 1)` is "pure" s opposed to `DIExpression(DW_OP_deref, DW_OP_LLVM_fragment 0, 1)`, which isn't? Or something else?

> Then this code could use that to detect when it is safe to do a `DwarfExpr.addExpression(std::move(ExprCursor))` to emit a `DW_OP_piece`. One would probably also need to introduce a new LocationKind constant (`ImplicitlyImplicit` :P) to indicate that there's no need to emit `DW_OP_stack_value`. Or it might be possible to reuse one of the existing kinds for this purpose.
>
> Does that sounds reasonable?

Are you saying that the code to emit FP constants is not passing the `DW_OP_LLVM_fragment` from `DIExpr` to `DwarfExpr` (and we happen to emit a skip-piece, which often has the same effect)? Shouldn't we then try to get DwarfExpression to process the fragment operator from `DIExpr` instead? I'm probably missing something...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92013



More information about the llvm-commits mailing list