[PATCH] D37929: [DebugInfo] Add missing DW_OP_deref when an NRVO pointer is spilled

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 14:34:58 PDT 2017


aprantl accepted this revision.
aprantl added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:894
+          // Modify DBG_VALUE now that the value is in a spill slot.
+          updateDbgValueForSpill(*DebugMI, SS);
+          DEBUG(dbgs() << "Modifying debug info due to spill:"
----------------
Nice.


================
Comment at: llvm/test/DebugInfo/X86/dbg-declare-arg.ll:4
 target triple = "x86_64-apple-macosx10.6.7"
 ; rdar://problem/9321650
 ;
----------------
According to the radar, the testcase was:

```
class A { public: int x; int y; int z; int o; ~A() { x = 1; }};

A foo(int i) {
  int j = 0;
  if (i == 42) {
    j = i + 1;
  };
  A a;
  a.x = j;
  return a;
}
```

Can you verify that end-to-end, this still works?
Apparently older versions of the testcase never checked for the expressions so it is hard to tell what it originally was.


https://reviews.llvm.org/D37929





More information about the llvm-commits mailing list