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.
Is that condition always safe to check if the scope is function-local? Just looking at the name of the function, it looks like we could change that one day to do something different for local scope (like create them right away like the name implies) and this would break the logic here.