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

Adrian Prantl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 14 16:25:45 PDT 2019


aprantl requested changes to this revision.
aprantl added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/lib/CodeGen/CGDecl.cpp:1572
+          ConvertTypeForMem(getContext().getLValueReferenceType(Ty));
+      DebugAddr = CreateTempAlloca(RefTy, getPointerAlign(), "nrvo_ref");
+      Builder.CreateStore(ReturnValue.getPointer(), DebugAddr);
----------------
We can't change IR generation based on whether debug info is enabled or not. The alloca should be emitted unconditionally.

It's a strong goal of LLVM that enabling/disabling debug info should have no effect on the contents of the .text section.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63361





More information about the cfe-commits mailing list