JVM IR: restore ability to suppress codegen-reported diagnostics

In the old backend, BindingContextSuppressCache is used (which is now
created explicitly in GenerationState), which looks up `@Suppress`
annotations on elements right before reporting the diagnostic. In JVM
IR, we clear the binding context after psi2ir, so this approach doesn't
work. This change provides another implementation of KotlinSuppressCache
which eagerly precomputes all suppressions on all annotated elements in
all source files at the point of creation of GenerationState (when the
binding context is still full).

 #KT-43047 Fixed
This commit is contained in:
Alexander Udalov
2020-11-02 18:32:01 +01:00
committed by Alexander Udalov
parent 61548a0a36
commit 106ee1d1ff
12 changed files with 142 additions and 34 deletions
@@ -17207,6 +17207,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/ir/simple.kt");
}
@TestMetadata("suppressConflictingSignatureErrors.kt")
public void testSuppressConflictingSignatureErrors() throws Exception {
runTest("compiler/testData/codegen/box/ir/suppressConflictingSignatureErrors.kt");
}
@TestMetadata("compiler/testData/codegen/box/ir/closureConversion")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)