]> granicus.if.org Git - clang/commit
DebugInfo: PR19298: function local const variables duplicated in the root scope
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 4 Apr 2014 20:56:17 +0000 (20:56 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 4 Apr 2014 20:56:17 +0000 (20:56 +0000)
commit531ba2d1b9b4728ee5a80c475d9617bf45867bab
tree7c0dbdf6f94511a1fd2fee6b4b3c6e14bb86e439
parenta92b40825a9a8345984433093b166d3b08353f8b
DebugInfo: PR19298: function local const variables duplicated in the root scope

See the comment for CodeGenFunction::tryEmitAsConstant that describes
how in some contexts (lambdas) we must not emit references to the
variable, but instead use the constant directly - because of this we end
up emitting a constant for the variable, as well as emitting the
variable itself.

Should we just skip putting the variable on the stack at all and omit
the debug info for the constant? It's not clear to me - what if the
address of the local is taken?

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