Don't try to construct debug LexicalScopes hierarchy for functions that do not have...
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 2 Jul 2014 18:31:35 +0000 (18:31 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 2 Jul 2014 18:31:35 +0000 (18:31 +0000)
commitf9b6d0373a5f2485c7ebab37f5b1215145951077
tree610396e241f203d43a4f23e7caa659922aed4f74
parent8446d2db2a4c8d197c5226ffc9f5fcf9aa80ae05
Don't try to construct debug LexicalScopes hierarchy for functions that do not have top level debug information.

If a function isn't actually in a CU's subprogram list in the debug info
metadata, ignore all the DebugLocs and don't try to build scopes, track
variables, etc.

While this is possibly a minor optimization, it's also a correctness fix
for an incoming patch that will add assertions to LexicalScopes and the
debug info verifier to ensure that all scope chains lead to debug info
for the current function.

Fix up a few test cases that had broken/incomplete debug info that could
violate this constraint.

Add a test case where this occurs by design (inlining a
debug-info-having function in an attribute nodebug function - we want
this to work because /if/ the nodebug function is then inlined into a
debug-info-having function, it should be fine (and will work fine - we
just stitch the scopes up as usual), but should the inlining not happen
we need to not assert fail either).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212203 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h
lib/CodeGen/LiveDebugVariables.cpp
lib/CodeGen/LiveDebugVariables.h
test/CodeGen/X86/2010-06-01-DeadArg-DbgInfo.ll
test/CodeGen/X86/dbg-changes-codegen-branch-folding.ll
test/DebugInfo/X86/concrete_out_of_line.ll
test/DebugInfo/nodebug.ll [new file with mode: 0644]