Commit Graph

14 Commits

Author SHA1 Message Date
Johan Bay d50b02adaf [K/N] only include bodies inside inlines for headers
Also renames the "header klib serializaion" option to something
that hopefully slightly better reflects its meaning
^KT-65442
2024-02-20 08:03:08 +00:00
Sergej Jaskiewicz c335cd0b1e [IR] Remove unused IrMessageLogger from serialization logic 2024-01-29 21:07:43 +00:00
Sergej Jaskiewicz eda30ff704 [klib] Implement diagnostics for clashing KLIB signatures
Now, we detect clashing signatures during serialization to KLIB and
report a compiler error if two or more declarations have the same
`IdSignature`

For example, for the following code:
```kotlin
@Deprecated("", level = DeprecationLevel.HIDDEN)
fun foo(): String = ""

fun foo(): Int = 0
```

the compiler will produce this diagnostic:
```
e: main.kt:1:1 Platform declaration clash: The following declarations
       have the same KLIB signature (/foo|foo(){}[0]):
    fun foo(): String defined in root package
    fun foo(): Int defined in root package
e: main.kt:4:1 Platform declaration clash: The following declarations
       have the same KLIB signature (/foo|foo(){}[0]):
    fun foo(): String defined in root package
    fun foo(): Int defined in root package
```

Note that we report this diagnostic during serialization and not earlier
(e.g., in fir2ir) for more robustness, so ensure that we check
exactly the signatures that will be written to a KLIB.
If we later introduce some annotation for customizing a declaration's
signature (e.g., for preserving binary compatibility), this
diagnostic will continue to work as expected.

^KT-63670 Fixed
2024-01-12 15:59:28 +00:00
Sergej Jaskiewicz a1970d3d57 [K/N] Move KonanIrModuleSerializer to serialization.native
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz 199d9d4880 [K/N] Move KonanDeclarationTable to the serialization.native module
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz 3f9de91bec [K/N] Move KonanIrFileSerializer to the serialization.native module
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz a032db500c [K/N] Move KonanFakeOverrideClassFilter to serialization.native
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz ff1b618dfd [K/N] Move KonanIdSignaturer to the serialization.native module
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz 7e3b909394 [K/N] Move some utils to the serialization.native module
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz 14e23a7d84 [K/N] Cache FqNames computed from ClassIds in KonanMangler 2023-09-13 14:25:13 +00:00
Sergej Jaskiewicz 9eba17d631 [K/N] Move Native-specific mangle constants to more suitable places
They shouldn't be mixed with target-independent constants.
2023-09-13 14:25:12 +00:00
Sergej Jaskiewicz e3b5dc509c [K/N] De-duplicate code for mangling objc interop function names
Extract the duplicated functionality to the
`ObjCFunctionNameMangleComputer` class.
2023-09-13 14:25:11 +00:00
Sergej Jaskiewicz 0fd4f10f6c [K/N] Avoid magic strings in KonanMangler 2023-09-13 14:25:10 +00:00
Sergej Jaskiewicz ddfd94b3b2 [K/N] Move KonanMangler to a new common module
^KT-61248 Fixed
2023-09-13 14:25:10 +00:00