[LL FIR] rework transformers, so transformers resolve only a specific set of declarations
The change is needed for the parallel resolution (^KT-55750), so we can resolve the declaration under a lock that is specific to this declaration. Previously, if LL FIR was resolving some FirClass, LL FIR resolved all its children too, and it had no control over what parts of the FIR tree were modified. The same applied to the designation path, sometimes the classes on the designation path might be unexpectedly (and without lock) modified. This commit introduces LLFirResolveTarget, which specifies which exact declarations should be resolved during the lazy resolution of the declaration. All elements outside the declarations specified for resolve in LLFirResolveTarget, should not be modified. The logic of lazy transformers is the following: - Go to target declaration collecting all scopes from the file and containing classes - Resolve only declarations that are specified by the LLFirResolveTarget, performing the resolve under a separate lock for each declaration ^KT-56543 ^KT-57619 Fixed
This commit is contained in:
committed by
Space Team
parent
18a8cfb090
commit
72def186a3
+42
@@ -70,6 +70,12 @@ public class FirStandaloneNormalAnalysisSourceModuleReferenceResolveTestGenerate
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/AnnotationOnFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("AnnotationOnFile2.kt")
|
||||
public void testAnnotationOnFile2() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/AnnotationOnFile2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("AnnotationOnFileWithImport.kt")
|
||||
public void testAnnotationOnFileWithImport() throws Exception {
|
||||
@@ -388,6 +394,30 @@ public class FirStandaloneNormalAnalysisSourceModuleReferenceResolveTestGenerate
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/NotEqualsOperator.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("PackageFromAnnotationOnFile.kt")
|
||||
public void testPackageFromAnnotationOnFile() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/PackageFromAnnotationOnFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("PackageFromAnnotationOnFileWithUnresolvedReference.kt")
|
||||
public void testPackageFromAnnotationOnFileWithUnresolvedReference() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/PackageFromAnnotationOnFileWithUnresolvedReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("PackageFromAnnotationOnFunction.kt")
|
||||
public void testPackageFromAnnotationOnFunction() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/PackageFromAnnotationOnFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("PackageFromAnnotationOnFunctionWithUnresolvedReference.kt")
|
||||
public void testPackageFromAnnotationOnFunctionWithUnresolvedReference() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/PackageFromAnnotationOnFunctionWithUnresolvedReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("PackageReference.kt")
|
||||
public void testPackageReference() throws Exception {
|
||||
@@ -769,12 +799,24 @@ public class FirStandaloneNormalAnalysisSourceModuleReferenceResolveTestGenerate
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/danglingAnnotations/DanglingAnnotationsResolvedClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("DanglingAnnotationsResolvedFile.kt")
|
||||
public void testDanglingAnnotationsResolvedFile() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/danglingAnnotations/DanglingAnnotationsResolvedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("DanglingAnnotationsResolvedLocal.kt")
|
||||
public void testDanglingAnnotationsResolvedLocal() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/danglingAnnotations/DanglingAnnotationsResolvedLocal.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("DanglingAnnotationsResolvedPackageFile.kt")
|
||||
public void testDanglingAnnotationsResolvedPackageFile() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/danglingAnnotations/DanglingAnnotationsResolvedPackageFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("DanglingAnnotationsResolvedTopLevel.kt")
|
||||
public void testDanglingAnnotationsResolvedTopLevel() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user