A Fix for Bug 19238.
Function static variable defined inside a lexical scope, same as typedef and record (class, struct or union), which are declared inside a lexical scope, were all associated to the function as its parent scope, rather than to the lexical scope they are defined or declared inside.
This patch provides a fix for all these three cases in the LLVM DWARF debug info generation.
I wouldn't add this here - the range concept is just "begin" and "end" - so there may be other ranges that don't have "empty". So we don't want to make our range-based algorithms overly restrictive by requiring that their ranges have 'empty'.
Instead this should be a free function: