Commit Graph

280 Commits

Author SHA1 Message Date
Roman Artemev 32bbc3b8ad [KLIB] Fix SimpleTypeKey in case of type abbreviation 2021-06-16 21:16:46 +03:00
Roman Artemev 2f772c7a7c [KLIB] Add IrStatementOrigin into IrConstructorCall message 2021-06-16 21:16:45 +03:00
Georgy Bronnikov fca804de14 IR: properly compute IrProperty.resolveFakeOverride()
Now that IrProperty has its own overriddenSymbols, we can generalize the
search for fake overrides. Also works for fake override properties
derived from Java fields.
2021-06-11 15:05:45 +03:00
Alexander Udalov 61d5595790 Remove dependency of ir.serialization.common on frontend 2021-06-01 20:28:23 +02:00
Alexander Udalov dfea915f92 Remove dependency of frontend on compiler.common.jvm
Looks like it was added accidentally in 564d382b9d; common frontend
shouldn't depend on JVM-specific modules.

Since then, it has been accidentally used in two places in
ir.serialization.common to refer to JVM specifics, and that should be
abstracted away in the future.
2021-06-01 20:28:23 +02:00
Alexander Udalov bcf47ddc94 Move optional annotation utilities to module 'resolution'
To avoid depending on a heavy module 'frontend' in parts of the compiler
where checking for optional annotations is needed, such as in
'ir.serialization.common'.
2021-06-01 20:28:22 +02:00
Alexander Udalov 8b3769b88e Remove dependency of ir.serialization.common on ir.backend.common 2021-06-01 20:28:22 +02:00
Roman Artemev 8a856e440e [KLIB] Fix linker diagnostic message 2021-05-28 13:37:30 +03:00
Alexander Udalov e0b0df01da Rename fields in KotlinIr.proto according to protobuf style guide
Field names should use snake_case, and names of repeated fields should
use the singular form: https://developers.google.com/protocol-buffers/docs/style#message_and_field_names
2021-05-20 15:59:42 +02:00
Dmitry Petrov 53c1de172f IR KT-46578 add IrProperty#overriddenSymbols 2021-05-14 16:20:18 +03:00
Dmitriy Novozhilov d114913cd2 Replace usages of addToStdlib.firstNotNullResult with firstNotNullOfOrNull 2021-05-14 14:30:19 +03:00
Alexander Udalov b5af93c8b4 Fix IR proto backward compatibility for InlineClassRepresentation
This is important only if any backend which uses IR serialization will
(accidentally or voluntarily) use `IrClass.inlineClassRepresentation`,
which is missing in IR of klibs serialized with 1.5.20 or earlier.

Note that at the moment only JVM IR is using
`IrClass.inlineClassRepresentation`, but ideally we'd like to change
that (if needed).
2021-05-13 13:58:43 +02:00
Alexander Udalov 54befa769f IR: add IrClass.getInlineClassRepresentation, serialize/deserialize it
The change in FirDeclarationUtil is needed because in case of unsigned
types loaded from the standard library, the primary constructor for some
reason is not the first, but the second in the list of constructors.
2021-05-13 13:56:59 +02:00
Svyatoslav Kuzmich ccc27b6a0c [IR] Add module property to IrFile 2021-04-26 18:52:42 +03:00
Dmitry Petrov 7e03f8ea80 JVM_IR KT-45853 include return type into Java method IdSignature
This is a hack required to accept [potentially] incorrect input
provided by the front-end; see KT-46042.
2021-04-12 22:52:08 +03:00
Anton Bannykh bcaad7487f JS PIR: regenerate .proto 2021-04-09 19:54:24 +03:00
Anton Bannykh 923303c2c1 JS PIR: move PIR proto messages to a separate file 2021-04-09 19:54:23 +03:00
Anton Bannykh 8fe8419ad4 JS IR: serialize declarations without mutable state 2021-04-09 19:54:21 +03:00
Anton Bannykh 1e822aa28a JS PIR: carrier serializer implementation 2021-04-09 19:54:20 +03:00
Anton Bannykh 030498c5e1 JS IR: updated .proto 2021-04-09 19:54:18 +03:00
Dmitriy Dolovov 50326f019b [IR] Use the proper encoding for string serialization
^KT-33175
2021-04-08 09:40:02 +03:00
Ilya Gorbunov e450a6494a Migrate deprecations in core, compiler, idea, tests
Replacing deprecated Char.toInt() with Char.code and
Number.toChar() with Number.toInt().toChar(), where Number is not Int.

KT-23451
2021-04-07 18:30:20 +03:00
Roman Artemev 44d03bc727 [Psi2Ir] Fix generation of property references for synthetic java props
- Declare it on use-site
 - Fix export checker for that case
 - Fix KT-45297
2021-03-18 16:50:31 +03:00
Roman Artemev 0d8fff7186 [KLIB] Fix annotation type deserialization
Instead of hardcoded `Unit` restore it basing on annotation class and
constructor's type arguments
2021-03-12 19:03:04 +03:00
Vladimir Ivanov fd02802028 [Native] Export KDoc into generated native header 2021-03-09 16:50:23 +03:00
Alexander Udalov f332192de8 IR: remove SourceManager, make PsiSourceManager a singleton 2021-03-05 20:46:33 +01:00
Roman Artemev 9bdfbc948c [KLIB] Support assignable value parameters in deserializer
- fix KT-44945
2021-03-05 13:47:07 +03:00
Anton Bannykh 87f3ca3f36 IR: make isExternal immutable 2021-03-02 14:30:18 +03:00
Anton Bannykh b0e0e62c0b Propagate isExternal flag in Psi2Ir and deserializer 2021-03-02 14:30:16 +03:00
Ilmir Usmanov d67e4f0c48 Rename inline class -> @JvmInline value class in stdlib and compiler 2021-02-25 16:06:51 +01:00
Alexander Udalov 7e149a3a44 IR: remove unneeded dependencies on psi2ir 2021-02-24 19:07:38 +01:00
Anton Bannykh bc9a791809 Refactor klib serializer/deserializer 2021-02-18 18:03:41 +03:00
Georgy Bronnikov db18ffc764 IR: only worry about threads in JvmIrSignatureDescriptor
General IdSignatureDescriptor is used from other backends, which have no
multi-threaded backend for now and do not need to carry the associated
runtime costs.

So IdSignatureDescriptor keeps the thread-unsafe caching of signature
builder.
2021-02-17 11:05:22 +03:00
Georgy Bronnikov c9d0448fd1 IR: use threadLocal 2021-02-17 11:05:21 +03:00
Roman Artemev 67671afab4 [Plugin API] Fix missed call in resolveBySignatureInModule 2021-02-11 11:44:09 +03:00
Roman Artemev d97a2b13c0 [Plugin API] Add API to load top level declaration by its signature
- request from JP Compose, #KT-44100
2021-02-09 11:56:20 +03:00
Roman Artemev bf67308cc2 [KLIB] Use IrMessageLogger in klib linker to report errors 2021-02-02 12:05:35 +03:00
Roman Artemev c5068b7d45 [KLIB] Drop unused logger 2021-02-02 12:05:34 +03:00
Roman Artemev 484b884d04 [KLIB] Make IrModuleDeserializer's printable 2021-02-02 12:05:34 +03:00
Pavel Kirpichenkov b66f5c8180 Drop type aliases for JS and KLIB string tables
They used to use the same approximation logic anyway
^KT-20996
2021-01-20 11:05:53 +03:00
Alexander Udalov 221f44da5f Fix warnings in stdlib/compiler/plugins/test code 2021-01-13 19:18:20 +01:00
Georgy Bronnikov c5961da780 IR: remove WrappedDescriptors altogether 2020-12-23 18:50:52 +03:00
Georgy Bronnikov b05400154d IR: remove IrSymbolDeclaration 2020-12-23 18:50:52 +03:00
Georgy Bronnikov d714adacae IR: removing WrappedDescriptors from symbols 2020-12-23 18:50:51 +03:00
Dmitry Petrov b0f6461fa9 JVM_IR KT-42020 special IdSignature for some fake override members 2020-12-15 12:56:45 +03:00
Alexander Udalov d9efc2d922 Fix warnings in compiler code and tests 2020-11-09 19:46:10 +01:00
Alexander Gorshenev cb288d47ea Don't serialize fake overrides anymore 2020-11-09 16:02:14 +03:00
Alexander Gorshenev 5de7a10df0 Eliminated -Xdeserialize-fake-overrides 2020-11-09 16:02:14 +03:00
Dmitry Petrov b9c6267a63 KT-43217 Encode @EnhancedNullability types in IdSignature 2020-11-09 15:20:46 +03:00
Roman Artemev 8ca9e792e9 [KLIB] Make sure that referenced local anonymous class is deserialzied.
In case if such class is used an type argument for field type make sure
that field initializer is being read.

Check type recursively.

- fix KT-41143
- update test
2020-11-05 20:28:11 +03:00