]> granicus.if.org Git - clang/commit
[CGDebugInfo] Finalize SubPrograms when we're done with them
authorKeno Fischer <keno@alumni.harvard.edu>
Thu, 1 Jun 2017 21:14:03 +0000 (21:14 +0000)
committerKeno Fischer <keno@alumni.harvard.edu>
Thu, 1 Jun 2017 21:14:03 +0000 (21:14 +0000)
commita86c471ab6451da7058e2284c9573a4a2ae68c65
treebd85d1071849182f77e2f5e8f101263d1a50c2fe
parentd3c869c889ad7c8fa419f9b4212de2290be83e0b
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304470 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h
lib/CodeGen/CodeGenFunction.cpp