[PATCH] D42527: [DebugInfo] Fix fragment offset emission order for symbol locations
David Stenberg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 26 04:36:45 PST 2018
dstenb added inline comments.
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:232
}
- if (Expr) {
- DwarfExpr->addFragmentOffset(Expr);
+ if (Expr)
DwarfExpr->addExpression(Expr);
----------------
JDevlieghere wrote:
> Just from looking at the code, as neither `Expr` nor `DwarfExpr` are used in the if-clause above, can we move up this part too?
The current order needs to be kept for the case where Expr is a DW_OP_LLVM_fragment expression. If we are dealing with a fragment expression, and we emit a symbol location in the `if (Global)` clause, then the piece resulting from the fragment expression must be emitted after that. This situation can be seen for the fragments corresponding to the `bar` and `qux` fields in the attached reproducer.
I don't if there are other cases where the emission order of the symbol location and `Expr` matters.
Repository:
rL LLVM
https://reviews.llvm.org/D42527
More information about the llvm-commits
mailing list