Make addArgument/addElement/putElement extension functions. This will
simplify transition to auto-generated IR.
Co-authored-by: mcpiroman <mcpiroman@gmail.com>
To simplify review of the upcoming IR tree generator.
Note that copyright is dated 2021, since that's in
license/COPYRIGHT_HEADER.txt which is used by generators.
This change only moves code around, no behavior is changed.
Specifically, ir.tree sources containing several declarations are split
into several files: one file per class, and one file for all extension
functions per package (IrDeclarations.kt, IrExpressions.kt,
IrVisitors.kt, IrConstructorCallTypeArguments.kt).
This is useful because after introducing IR tree generator, we can
easily see how generated sources are different from those which were
written manually, since Git will recognize file moves. Also, it will
keep Git history for sources which consisted of one big class + a couple
of extension functions (e.g. IrElementVisitorVoid.kt).
Kotlin Android extensions plugin adds layout directories as input to
KotlinCompile task when experimental flag is enabled. This breaks
cache relocation.
^KT-48849 Fixed
System property `compilerClasspath` in tests references absent file
cannot find (.../kotlin/prepare/compiler/build/libs/kotlin-compiler-1.6.255-SNAPSHOT.jar)
java.io.FileNotFoundException: cannot find (.../kotlin/prepare/compiler/build/libs/kotlin-compiler-1.6.255-SNAPSHOT.jar)
at org.jetbrains.kotlin.compiler.client.CompilerClientIT.filesFromProp(CompilerClientIT.kt:63)
at org.jetbrains.kotlin.compiler.client.CompilerClientIT.access$filesFromProp(CompilerClientIT.kt:40)
at org.jetbrains.kotlin.compiler.client.CompilerClientIT$compilerClasspath$2.invoke(CompilerClientIT.kt:47)
at org.jetbrains.kotlin.compiler.client.CompilerClientIT$compilerClasspath$2.invoke(CompilerClientIT.kt:46)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
...
Previously enhanced symbols were cached inside SignatureEnhancement,
which is created independently for each enhancement scope. This may
cause creation of multiple enhanced symbols for same java declaration
in presence of multiple scope sessions (mutithread compiler, IDE,
separate scope session for checkers)
^KT-50858 Fixed
This big refactoring is needed to cleanup building of overrides
mappings and prevent creating redundant intersection overrides in
cases when there is no need in them:
```kotlin
interface A {
fun foo()
}
interface B {
fun foo()
}
interface C : A, B {
override fun foo()
}
```
Before this refactoring there was next override tree:
C.foo
intersection override (A.foo, B.foo)
A.foo
B.foo
Also this commit fixes special mapping of overrides in jvm scopes
for declarations which have kotlin builtins in supertypes with
special java mapping rules (collections, for example)
This is much more correct, because we have one to one mapping for
special java functions in this case, so using single nullable name
instead of list of names makes code more readable
It's safe as not having const is more restrictive, therefore can be
allowed in common. Otherwise, it's not possible to declare an expect
declaration for a platform property with `const` modifier in common
KT-18856