localDecls is intended to track static locals, function- (or lexical-block-) local types (plus typedefs, enums and unions) and imported entities.
Main motivation for adding new field for DISubprogram and DILexicalBlock is to implement more accurate handling for function-local declarations (types, imports and static locals) and support lexical block scopes for them (see D125693).
Thus static locals, function-local enums and imported entities are no longer go to compile unit's 'globals', 'enums' and 'imports'.
But if '-debug-info-kind' is specified as 'unused-types', function-local type-like entities will be referenced by CUs 'retainedTypes'.
This patch just adds localDecls field, corresponding clang/backend changes are in next patches.
clang-format suggested style edits found: