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

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 06:47:38 PST 2020


labath added a comment.

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. 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?


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