summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorKeno Fischer <keno@alumni.harvard.edu>2017-06-01 21:14:03 +0000
committerKeno Fischer <keno@alumni.harvard.edu>2017-06-01 21:14:03 +0000
commit41d4b4e588e514d6b0df249970e63e61fe28ead0 (patch)
tree0b700defb498e9f6cfb51f8fe87850b09e1cdceb /clang/lib/CodeGen/CodeGenFunction.cpp
parent596b2e7ab2e81fa7a93450e85215066de5f80b1f (diff)
downloadbcm5719-llvm-41d4b4e588e514d6b0df249970e63e61fe28ead0.tar.gz
bcm5719-llvm-41d4b4e588e514d6b0df249970e63e61fe28ead0.zip
[CGDebugInfo] Finalize SubPrograms when we're done with them
`GenerateVarArgsThunk` in `CGVTables` clones a function before the frontend is done emitting the compilation unit. Because of the way that DIBuilder works, this means that the attached subprogram had incomplete (temporary) metadata. Cloning such metadata is semantically disallowed, but happened to work anyway due to bugs in the cloning logic. rL304226 attempted to fix up that logic, but in the process exposed the incorrect API use here and had to be reverted. To be able to fix this, I added a new method to DIBuilder in rL304467, to allow finalizing a subprogram independently of the entire compilation unit. Use that here, in preparation of re-applying rL304226. Reviewers: aprantl, dblaikie Differential Revision: https://reviews.llvm.org/D33705 llvm-svn: 304470
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 85da3ae47db..b6d7f025501 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -348,7 +348,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
// Emit debug descriptor for function end.
if (CGDebugInfo *DI = getDebugInfo())
- DI->EmitFunctionEnd(Builder);
+ DI->EmitFunctionEnd(Builder, CurFn);
// Reset the debug location to that of the simple 'return' expression, if any
// rather than that of the end of the function's scope '}'.
OpenPOWER on IntegriCloud