[PATCH] D48837: [DebugInfo] Corrections for salvageDebugInfo

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 2 10:09:35 PDT 2018


vsk added inline comments.


================
Comment at: lib/IR/DebugInfoMetadata.cpp:808
+  if (Ops.empty())
+    StackValue = false;
   if (Expr)
----------------
bjope wrote:
> vsk wrote:
> > Is there a reason to allow callers to convert an expression into a stack value without adding any opcodes? Why not assert this can't happen?
> I was actually thinking about using an assert here. I did "git grep DIExpression::prepend" and found out that some users of DIExpression::prepend/DIExpression::prependOpcodes explicitly avoids calling those function with a zero Offset (or empty Ops vector), but some don't (an example is SelectionDAG::salvageDebugInfo). So I did not dare to add an assert.
Thanks for pointing out that example. We can revisit tightening assertions in DIExpression::prepend* and see if that helps make it clearer whether or not some call turns an expression into a stack value.


Repository:
  rL LLVM

https://reviews.llvm.org/D48837





More information about the llvm-commits mailing list