[PATCH] D63361: Pretend NRVO variables are references so they can be found by debug info
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 19 09:58:46 PDT 2019
rnk 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);
----------------
akhuang wrote:
> 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`?
I guess adding a boolean to EmitDeclareOfAutoVariable would be the way to go, and then to thread that through here.
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