[PATCH] D63361: Pretend NRVO variables are references so they can be found by debug info

Amy Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 09:44:21 PDT 2019


akhuang marked an inline comment as done.
akhuang added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:3946
+  // the address of the variable.
+  if (VD->isNRVOVariable())
+    Expr.push_back(llvm::dwarf::DW_OP_deref);
----------------
rnk wrote:
> I think we should check for `getLangOpts().ElideConstructors` here, and check that the debug info is correct (no deref) in that mode.
Makes sense, though now I realized there is also an issue because CGDecl checks whether `ReturnValuePointer` is valid before changing the debug value, but CGDebugInfo doesn't check this when adding DW_OP_deref.. so maybe it makes sense to pass something through to `EmitDeclare`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63361/new/

https://reviews.llvm.org/D63361





More information about the llvm-commits mailing list