A Fix for Bugs PR19238 & PR24008.
This patch introduces an improvement to "D9758", which did not consider optimized code (especially inline).
Requires D12426 to be committed first.
Changes include:
- Allow creating DIEs that have a lexical block scope without attaching them to a context.
- Collect these DIEs in information container associated with the lexical scope.
- Collect abstract, inline, and concrete lexical block DIEs in information container associated with the lexical scope.
- Assure lexical scope contains local DI nodes to have an entry in the abstract function, if such exists.
- At "endModule()", move collected local DIEs to the abstract lexical block DIE, if exists. Otherwise, move them to the concrete lexical block.
Even with this patch we still have the following issues (Could be solved in separate following patch/es):
- types and local static variables declared in the function scope are still handled as before, i.e. will always be emitted in the concrete function, even when an abstract function exist.
- In the inline lexical block there is no mention for the type and local static variable, even not an entry with "abstract_origin" attribute.
- The lexical block hierarchy of inline function might defer from one inline site to another, however, the abstract function contains a unification of all these hierarchies.
Could probably just roll the local variable into the for loop header.