[PATCH] D31604: [DebugInfo][X86] Improve X86 Optimize LEAs handling of debug values.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 09:14:31 PDT 2017


aprantl added inline comments.


================
Comment at: lib/Target/X86/X86OptimizeLEAs.cpp:559
+      SmallVector<uint64_t, 8> Elements(OrigElements.size() + 1);
+      Elements[0] = dwarf::DW_OP_stack_value;
+      std::copy(OrigElements.begin(), OrigElements.end(),
----------------
andrewng wrote:
> aprantl wrote:
> > Are you sure you want the DW_OP_stack_value at position 0? Shouldn't it go either at the end of the expression or just before a DW_OP_llvm_fragment operation?
> Yes, I think it needs to be there otherwise any existing operations will be operating on the wrong value.
Sorry, this was a rhetorical question. The DW_OP_stack_value operation always terminates the expression. It *must* come at the end (but before DW_OP_LLVM_fragement). You can factor out the code in Local.cpp from prependDIExpr() and move it into a static member function of DIExpression.


https://reviews.llvm.org/D31604





More information about the llvm-commits mailing list