[PATCH] D42527: [DebugInfo] Fix fragment offset emission order for symbol locations

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 06:44:43 PST 2018


JDevlieghere added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:232
     }
-    if (Expr) {
-      DwarfExpr->addFragmentOffset(Expr);
+    if (Expr)
       DwarfExpr->addExpression(Expr);
----------------
dstenb wrote:
> 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.
Thanks for the explanation! 


Repository:
  rL LLVM

https://reviews.llvm.org/D42527





More information about the llvm-commits mailing list