diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-02-27 21:30:05 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-02-27 21:30:05 +0000 |
commit | b7acfc0139bba6f5fdc3f4c409411f03dce543ab (patch) | |
tree | 1b5692bfe2fc15d07a2d8bf3443fd51140605ff5 /clang/lib/CodeGen/CGClass.cpp | |
parent | 614e60de1cf9a016da5359c40000656ca911e6e8 (diff) | |
download | bcm5719-llvm-b7acfc0139bba6f5fdc3f4c409411f03dce543ab.tar.gz bcm5719-llvm-b7acfc0139bba6f5fdc3f4c409411f03dce543ab.zip |
PR32042: Create inlined debug info for EmitInlinedInheritingCXXConstructorCall.
When clang emits an inheriting C++ constructor it may inline code
during the CodeGen phase. This patch ensures that any debug info in
this inlined code gets a proper inlined location. Otherwise we can end
up with invalid debug info metadata, since all inlined local variables
and function arguments would be reparented into the call site.
Analogous to ApplyInlineLocation this patch introduces a
ApplyInlineDebugLocation scoped helper to facilitate entering an
inlined scope and cleaning up afterwards.
This fixes one of the issues discovered in PR32042.
rdar://problem/30679307
llvm-svn: 296388
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index 365da4f1351..7ba03a0d42d 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -2128,7 +2128,9 @@ void CodeGenFunction::EmitInheritedCXXConstructorCall( void CodeGenFunction::EmitInlinedInheritingCXXConstructorCall( const CXXConstructorDecl *Ctor, CXXCtorType CtorType, bool ForVirtualBase, bool Delegating, CallArgList &Args) { - InlinedInheritingConstructorScope Scope(*this, GlobalDecl(Ctor, CtorType)); + GlobalDecl GD(Ctor, CtorType); + InlinedInheritingConstructorScope Scope(*this, GD); + ApplyInlineDebugLocation DebugScope(*this, GD); // Save the arguments to be passed to the inherited constructor. CXXInheritedCtorInitExprArgs = Args; |