DebugInfo: Correctly describe the lexical decl context of static member variable...
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 23 Oct 2014 16:39:49 +0000 (16:39 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 23 Oct 2014 16:39:49 +0000 (16:39 +0000)
commit3813b2650f57043cb52654615bdd486d7027a558
treeed0df058a5ce12860bc9908607a2a016b300f3ce
parentbcfa8a56b14261230338701369ed693e958475a0
DebugInfo: Correctly describe the lexical decl context of static member variable definitions.

The previous IR representation used the non-lexical decl context, which
placed the definitions in the same scope as the declarations (ie: within
the class) - this was hidden by the fact that LLVM currently doesn't
respect the context of global variable definitions at all, and always
puts them at the top level (as direct children of the compile_unit).
Having the correct lexical scope improves source fidelity and simplify
backend global variable emission (with changes coming shortly).

Doing something similar for non-member global variables would help
simplify/cleanup things further (see FIXME in the commit) and provide
similar source fidelity benefits to the final debug info.

llvm-svn: 220488
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGenCXX/debug-info-static-member.cpp