]> granicus.if.org Git - clang/commit
Fully handle globals and functions in CGDebugInfo::getDeclarationOrDefinition()
authorFrederic Riss <friss@apple.com>
Tue, 18 Nov 2014 03:40:51 +0000 (03:40 +0000)
committerFrederic Riss <friss@apple.com>
Tue, 18 Nov 2014 03:40:51 +0000 (03:40 +0000)
commitc80925de22dcfae31db1e05d3c40b8d6b7e072bf
tree93b640bde680b0380c05be31785c6be9e688a274
parenta00a4bcede57362261c01f6135e802763d8dec33
Fully handle globals and functions in CGDebugInfo::getDeclarationOrDefinition()

Currently this function would return nothing for functions or globals that
haven't seen a definition yet. Make it return a forward declaration that will
get RAUWed with the definition if one is seen at a later point. The strategy
used to implement this is similar to what's done for types: the forward
declarations are stored in a vector and post processed upon finilization to
perform the required RAUWs.

For now the only user of getDeclarationOrDefinition() is EmitUsingDecl(), thus
this patch allows to emit correct imported declarations even in the absence of
an actual definition of the imported entity.

(Another user will be the debug info generation for argument default values
that I need to resurect).

Differential Revision: http://reviews.llvm.org/D6173

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222220 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h
test/CodeGenCXX/debug-info-namespace.cpp