Commit Graph

155 Commits

Author SHA1 Message Date
Vladimir Ivanov fd02802028 [Native] Export KDoc into generated native header 2021-03-09 16:50:23 +03:00
Alexander Udalov addabae8d2 IR: move frontend-dependent code into implementations in psi2ir 2021-02-24 19:07:38 +01:00
Alexander Udalov d991a3e40f IR: simplify initialization cycle of TypeTranslator/ConstantValueGenerator 2021-02-24 19:07:38 +01:00
Alexander Udalov 5ea3d32b98 IR: remove TranslationPluginContext.bindingContext
This removes another dependency of 'ir.tree' on 'frontend', and among
other things, makes it possible to implement TranslationPluginContext
for FIR in the future.
2021-02-24 19:07:38 +01:00
Alexander Udalov 837eb739ea IR: move CompilationErrorException to frontend.common 2021-02-24 19:07:37 +01:00
Alexander Udalov 1ae46b529f IR: move ExpectDeclarationRemover to ir.backend.common 2021-02-24 19:07:37 +01:00
Alexander Udalov ca5a35b4b3 Move CompilerEnvironment from 'frontend' to 'cli'
This is needed in order to have a single convenient place where to
register frontend services implemented _outside_ of the 'frontend'
module, such as the control flow analysis, extracted to a separate
module in a subsequent commit.
2021-02-24 17:17:03 +01:00
Anton Bannykh bc9a791809 Refactor klib serializer/deserializer 2021-02-18 18:03:41 +03:00
Roman Artemev 59551eb037 [Plugin API] Provide diagnostic API for IR plugins 2021-02-02 12:05:35 +03:00
Roman Artemev bf67308cc2 [KLIB] Use IrMessageLogger in klib linker to report errors 2021-02-02 12:05:35 +03:00
Roman Artemev 24d82c63e0 [JS IR] Commonize CLI error reporting
Use general `AnalysisResult.CompilationErrorException` instead of
custom JsIrCompilationError to indicate about unsuccessful compilation

- Drop JsIrCompilationError
2021-02-02 12:05:34 +03:00
Roman Artemev ba5193870e [IR] Drop unused language version settings parameters from DependenciesGenerator 2021-02-02 12:05:34 +03:00
Roman Artemev b0adcffed9 [JS IR] Fix transitive dependency resolve 2021-01-26 19:23:25 +03:00
Roman Artemev cd9e341fa9 [JS IR] Support additional repositories in CLI (compiler part) 2021-01-26 19:23:22 +03:00
Alexander Gorshenev f42b902bc8 Made -Xfake-override-validator off by default
Deprected -Xdisable-fake-override-validator
2020-11-18 12:46:40 +03: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
Alexander Gorshenev 891a4c4621 Dropped outdated klib version compatibility mechanisms 2020-11-06 16:19:43 +03:00
Leonid Startsev 4ec90b18bc Rework DescriptorSerializerPlugin to be a part of Project's extensions
instead of statically registering it.

Static registering can cause subtle errors when plugin implementation
(e.g. SerializationDescriptorPluginForKotlinxSerialization) is registered
from multiple classloaders: in multi-module with daemon compilation scenario

 #KT-41857 Fixed
2020-10-22 17:04:35 +03:00
Alexander Gorshenev 223d1dd5e6 [Private fake overrides] Private fake override construction 2020-10-22 13:23:28 +03:00
Roman Artemev c89c31cd29 [KLIB] Fix package name (js -> common) 2020-10-15 13:55:06 +03:00
Roman Artemev 07a1124b99 [KLIB] Support error code in metadata 2020-10-15 13:55:06 +03:00
Roman Artemev 0f7032051b [JS IR] Fix klib generation (proper order of flags) 2020-10-15 13:55:06 +03:00
Roman Artemev a4945878aa [KLIB] Pass containsErrorCode flag from library/IC cache into deserializer
- Make deserializer track whether error node are allowed.
2020-10-15 13:55:05 +03:00
Roman Artemev 28c6d17ab4 [KLIB] Mark klib that contains error with special flag 2020-10-15 13:55:05 +03:00
Leonid Startsev f2cf64aec7 Create plugin context before launching actual psi2ir process.
Because IrPluginContextImpl constructor creates new instance of
BuiltinSymbolsBase (with symbols for stdlib declarations like `arrayOf` etc),
there should be at least one pass of `declareUnboundSymbolsAsDependencies`
between creation and usage in plugin. Such pass is located between psi2ir
and compiler plugins application. If plugin context is created inside lambda,
right before plugins are applied, the symbols will remain unbound.

 #KT-41764 Fixed
2020-09-18 14:58:38 +03:00
Roman Artemev a60782f3df [JS IR] Add CLI argument to setup error tolerance policy
-  Make sure dev mode is enabled if code with errors is allowed
2020-09-01 14:53:07 +03:00
Roman Artemev a095909d5c [Plugin API] Provide special context in EP for link-time resolve
- requires to customize declarations from synthetic declarations
2020-08-24 15:37:39 +03:00
Roman Artemev 8d61e9ba21 [KLIB] Load @JsExport annotated declarations explicitly 2020-08-20 22:13:39 +03:00
Alexander Udalov a810dbb41b IR: fix compiler warnings 2020-08-18 10:33:25 +02:00
Alexander Udalov db4cbe7103 IR: use IrFactory in SymbolTable 2020-07-28 12:05:23 +02:00
Alexander Udalov d3a34a8898 Psi2Ir: somewhat simplify Psi2IrTranslator API
Inline some methods only used once, deduplicate usages, rearrange
parameters, etc.
2020-07-22 22:38:21 +02:00
Alexander Gorshenev e61960f333 Fake override construction fallback mode 2020-06-29 21:58:31 +03:00
Alexander Gorshenev de79e3bec3 Added -Xdisable-fake-override-validator 2020-06-29 21:58:31 +03:00
Mikhail Glukhikh 6f957c7b31 Provide more accurate clash check in JsDeclarationTable 2020-06-16 19:17:26 +03:00
Mikhail Glukhikh 63394858ac Minor typo fix 2020-06-16 19:17:08 +03:00
Mikhail Glukhikh 41306d25fd JsDeclarationTable: drop descriptors in assertion 2020-06-16 19:16:59 +03:00
Roman Artemev 5eae262264 [PLUGIN API] Implement custom linkage for plugin extensions 2020-06-03 12:17:14 +03:00
Roman Artemev f9c2c846f7 [IR] Move IrProvider and 'IrDeserializer' into separate package 2020-06-03 12:17:14 +03:00
Leonid Startsev 7c8c5b057f Extensible mechanism for plugin metadata during descriptor serialization
A mechanism that allows kotlinx.serialization plugin to preserve the
correct (program) order of properties after serializing/deserializing
descriptors to kotlin metadata, which is needed for correct and stable
json serialization of class hierarchies in incremental/multi-module scenario.
It uses protobuf extensions.
2020-06-01 17:48:16 +03:00
Alexander Gorshenev a112f8acb6 Moved symbol table emptiness assertion to later places,
so that the assert doesn't trigger in the plugin context
2020-05-31 06:00:33 +03:00
Alexander Gorshenev 46e3649bd0 Moved all things related to fake overrides to a single directory 2020-05-31 06:00:32 +03:00
Alexander Gorshenev 06abbe468b Signature based fake override validation 2020-05-31 06:00:32 +03:00
Alexander Gorshenev 024385cbbd Construct fake overrides after IR deserialization 2020-05-31 06:00:32 +03:00
Roman Artemev e6c855111e [KLIB] Add flag to select between per-file and monolithic layout 2020-05-26 14:41:49 +03:00
Roman Artemev 257c4c5604 [PLUGIN API] Extract IrPluginContext into separate interface
- Isolate ir infrastructure implementation details behind special interface
2020-05-25 13:26:35 +03:00
Kevin Most 4f26ac9a04 Fix "Koltin" typos throughout codebase (#3383)
* Fix "Koltin" typos throughout codebase

* Update K2MetadataKlibSerializer.kt
2020-05-20 15:12:32 +03:00
Alexander Udalov 012ffa2993 Support new scheme of compilation of OptionalExpectation annotations
Instead of generating these annotation classes as package-private on
JVM, serialize their metadata to the .kotlin_module file, and load it
when compiling dependent multiplatform modules.

The problem with generating them as package-private was that
kotlin-stdlib for JVM would end up declaring symbols from other
platforms, which would include some annotations from package
kotlin.native. But using that package is discouraged by some tools
because it has a Java keyword in its name. In particular, jlink refused
to work with such artifact altogether (KT-21266).

 #KT-38652 Fixed
2020-05-12 19:28:57 +02:00
Roman Artemev 9f99094780 [IR] Clean up linker interface 2020-05-12 14:29:54 +03:00
Roman Artemev 1e9c9ef7e0 [IR] Clean up linker code 2020-05-12 14:29:54 +03:00