[PATCH] [RFC] Rewrite the way we generate debug locations for variables.

Alexey Samsonov samsonov at google.com
Thu Jan 30 12:07:53 PST 2014


  Hi Adrian,

  Sorry for the lack of doxygen-comments for functions, I'll add them with the next version of the patch.

  > This is a really naive question, but it will help me understand your decisions better: would it be possible to change codegen to insert a DBG_VALUE into every MC block that post-dominates the basic block that contained the original dbg.declare/value intrinsic?

  This might make things a bit easier, but:
  a) this would bloat the MachineFunction, and IIRC David mentioned that some people complain about the number of DBG_VALUE calls already.
  b) This might be confusing. E.g.
    BB1:
      DBG_VALUE: var "x" is in %rax
      clobber %rax
      jmp BB2
    BB2:
      // we probably shouldn't insert DBG_VALUE for "x" here, it's inaccessible.

  or

    BB1:
      DBG_VALUE: var "x" is in %rax
      jmp BB3
    BB2:
      DBG_VALUE: var "x" is in %rbx
      jmp BB3
    BB3:
      // what DBG_VALUE for "x" should we insert here?

  We probably can add a pass to CodeGen that would perform similar (to this patch) kind of analysis and add additional DBG_VALUE calls, making debug info generation more straightforward. Here, instead, I try to not make any assumptions about the CodeGen output and do the best I can, w/o modifying the code.

http://llvm-reviews.chandlerc.com/D2658



More information about the llvm-commits mailing list