| Refactor 'ImportPathManager' & 'ExternalSources' Issue: https://gitcode.com/openharmony/arkcompiler_ets_frontend/issues/8938 Description: ImportPathManager: 1. Make 'ImportPathManager' responsible for 'Program' creation. 2. Specialize 'Program's by 'util::ModuleKind', 'Program' is an abstract base. 3. Refactor 'Program::externalSources_'; 4. Gather all the global-caches under 'ImportPathManager' (ast-cache, source-cache, decl-cache). 5. Reduce 'resolvedSource', 'declPath', 'ohmUrl', 'declText' and etc. interference: * Define 'ohmUrl' as fs-independent 'resolvedSource' * 'moduleName' is formed in the following way: 1. Form 'resolvedSource' (absolute-path). 2. Form 'ohmUrl' based on matching 'resolvedSource' with fields of arktsconfig. 3. If wasn't matched, 'ohmUrl' is just a filename (w/o extension). 4. Form 'moduleName' by repalcing '/' with '.' in 'ohmUrl'. 6. Simplify '.etscache' path resolving by 'cacheDir'/'ohmUrl'.etscache. Phases: 1. Skip "before-emit-decl" phases for 'Program's constructed from decl-caches. 2. Replace 'PhaseForBodies' and 'PhaseForDeclarations' with 'PhaseFor<ModuleKind...>' Programs. 3. Introduce 'PhaseForProgramsToBeEmitted'. Signed-off-by: Daniel Kofanov <kofanov.daniil@huawei-partners.com> Co-authored-by: nikozer <ozerov.nikita@huawei-partners.com> Co-authored-by: Zelentsov Dmitriy <zelentsov.dmitry@huawei-partners.com> Co-authored-by: Klimentieva <klimentieva.maria@h-partners.com> Co-authored-by: lirismankarina <lirisman.karina@huawei-partners.com> Co-authored-by: Amosov Alexey <amosov.alexey1@huawei-partners.com> Co-authored-by: Dmitry Pimenov <pimenov.dmitry@huawei-partners.com> Change-Id: Icef66995940b4dcd69653108cdc6e2268b52102e | 4 个月前 |