[PATCH] D32920: Don't add DBG_VALUE instructions for static allocas in dbg.declare

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 08:57:35 PDT 2017


rnk added a comment.

In https://reviews.llvm.org/D32920#747734, @aprantl wrote:

> I totally understand that it doesn't need to be tracked in the MMI table and in a DEBUG_VALUE, my question was that it sounded to my like you implied that the DWARF backend actively ignores DEBUG_VALUEs pointing to static allocas which I found really surprising (as there are legitimate reasons for allocas to be described by a DEBUG_VALUE) .


The backend doesn't ignore DEBUG_VALUEs pointing to static allocas, it ignores DEBUG_VALUEs when there is an entry for the same variable in the dbg.declare side table. It's this code:

  void DwarfDebug::collectVariableInfo(DwarfCompileUnit &TheCU,
                                       const DISubprogram *SP,
                                       DenseSet<InlinedVariable> &Processed) {
    // Grab the variable info that was squirreled away in the MMI side-table.
    collectVariableInfoFromMFTable(Processed);
  
    for (const auto &I : DbgValues) {
      InlinedVariable IV = I.first;
      if (Processed.count(IV))
        continue;


https://reviews.llvm.org/D32920





More information about the llvm-commits mailing list