Commit Graph

2415 Commits

Author SHA1 Message Date
Dmitriy Novozhilov f82c7c4678 [FIR] Cleanup session creation utils 2021-03-11 13:10:04 +03:00
Vladimir Ivanov fd02802028 [Native] Export KDoc into generated native header 2021-03-09 16:50:23 +03:00
scaventz 9a7ef11043 Report a readable diagnostic on empty -J argument in CLI 2021-03-06 03:14:11 -08:00
scaventz 81a495b494 Fix the NullPointerException when pathname does not name a parent. 2021-03-06 01:50:40 -08:00
Alexander Udalov 566f97ae3e JVM IR: remove dependency of 'backend.jvm' on 'psi2ir', 'ir.serialization.jvm'
Add a new module 'backend.jvm.entrypoint' which depends on psi2ir and
contains code that runs psi2ir + JVM IR backend with serialization
implementations.

Hopefully this will allow to compile these modules in parallel and
reduce the build time.
2021-03-05 20:46:33 +01:00
Alexander Udalov 1f8de46b3c JVM IR: do not depend on StubGeneratorExtensions in backend
Move most of the implementation from JvmGeneratorExtensions to
JvmGeneratorExtensionsImpl. The latter implements
StubGeneratorExtensions from psi2ir, and doing so helps to remove direct
dependency on this part of psi2ir from backend.
2021-03-05 20:46:33 +01:00
Alexander Udalov f332192de8 IR: remove SourceManager, make PsiSourceManager a singleton 2021-03-05 20:46:33 +01:00
Alexander Udalov e7e17cdaa9 Revert "Fix KotlinCoreEnvironment projectCount disposable"
This reverts commit 99a6bdeec7.

 #KT-45007 Fixed
2021-03-05 17:40:39 +01:00
scaventz 28452fc38e Kotlinc: catch FileNotFoundException caused by problematic destination. 2021-03-04 11:25:35 -08:00
Alexander Likhachev 70d434e992 Update tests after compiler properties rework
#KT-43605 Fixed
2021-03-04 19:36:18 +03:00
Alexander Likhachev 3537c699b5 [Gradle] Read system properties at configuration time using Gradle providers
The change is a step to fully support Gradle configuration cache.
Relates to #KT-43605
Relates to #KT-44611
2021-03-04 19:36:11 +03:00
Alexander Udalov 837eb739ea IR: move CompilationErrorException to frontend.common 2021-02-24 19:07:37 +01:00
Alexander Udalov 2e2caae05c Extract control flow analysis to separate module
Extract a service interface out of ControlFlowInformationProviderImpl
and register its implementation in two "leaf" modules: 'cli',
'idea-core'.

This improves parallel build, since a lot of modules depend on
'frontend' but only these two modules reference the implementation and
thus depend on the full CFA implementation now.
2021-02-24 17:17:04 +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
Alexander Udalov 862a9143da Do not report errors about bytecode version
#KT-41758
2021-02-23 12:45:40 +01:00
Ilya Goncharov bd2601f289 [JS IR] Extract adding of function call to another function
[JS IR] Add option for dce mode

[JS IR] Add logging to non useful declarations if appropriate dce mode

[JS IR] Add mode with throwing exception

[JS IR] unreachableDeclaration method is in rootDeclarations

[JS IR] Add js extra help arg with dce mode and include debug.kt to compile unreachableMethod

[JS IR] unreachableDeclaration as internal to not reproduce stdlib api

[JS IR] Fix description of dce mode argument

- Use console.error instead of console.log
- Use JsError instead Kotlin exception for lightweight

[JS IR] Remove body for throwing exception

[JS IR] Remove default parameter in unreachableDeclaration

[JS IR] Process without removing fields and declaration containers

[JS IR] Rename dce mode on dce runtime diagnostic

[JS IR] Use console.trace instead of console.error

[JS IR] Extract JsError

- Fix naming in prependFunctionCall
- Fix description on runtime diagnostic argument
- Using message collector instead of throwing exception

[JS IR] Distinguish unreachableMethods for log and exception

[JS IR] Extract checking of Kotlin packages of IrField

^KT-45059 fixed
2021-02-20 12:05:06 +03:00
Alexander Udalov 49fc1b9e3e Build: enable -Werror for several modules 2021-02-18 12:14:09 +01:00
Mikhael Bogdanov e3e7e6b740 Make indy-with-constants default for -jvm-target 9+
#KT-42522 Fixed
2021-02-17 18:43:23 +01:00
Georgy Bronnikov 103f82c95c IR: an option to automatically select the number of lowering threads 2021-02-17 11:03:27 +03:00
Georgy Bronnikov 52b3cb362b IR: thread pool in PerformByIrFilePhase 2021-02-17 11:03:27 +03:00
Georgy Bronnikov bea5d955d4 JVM_IR: perform file lowerings in parallel
Selected by -Xir-run-lowerings-in-paralled compiler flag.
2021-02-17 11:03:26 +03:00
Anton Bannykh c06b345f3c Hide stageController into the IrFactory 2021-02-17 10:42:50 +03:00
Yaroslav Chernyshev 17fc10a8af Mark obsolete Gradle JVM options as Deprecated with Error
Options `includeRuntime`, `noStdlib` and `noReflect` were affected
#Fixed KT-44361
2021-02-10 21:21:03 +03:00
Alexander Udalov e6588ee8a4 CLI: include META-INF/services/ from kotlin-reflect with -include-runtime
This is an addition to bd205317aa where we
started to add the contents of kotlin-reflect into the resulting jar if
-include-runtime is specified. Apparently kotlin-reflect doesn't work
without some services in META-INF/services/, which didn't satisfy the
condition for inclusion. The existing test didn't catch that because
loading class annotations does not always lead to those services being
loaded.
2021-02-10 12:05:36 +01:00
Georgy Bronnikov 1664eec7e4 FIR: report lowering time from JvmIrCodegenFactory 2021-02-09 10:59:35 +03:00
Pavel Kirpichenkov 75954dd1a4 Minor: refactor extended compiler checks
Use an analysis flag instead of a stub language feature
2021-02-08 18:47:30 +03:00
Pavel Kirpichenkov 2a46da906c Provide additional information about missing supertypes
Add -X flag to report extra compiler diagnostics which migth break compatibility.
Use the flag to unconditionally check constructors without fear of
prematurely evaluating lazy supertypes.

KT-19234
KT-42404
KT-44583
2021-02-08 18:47:30 +03:00
Alexander Udalov bd45a6c11d Support -Xsuppress-version-warnings to suppress API/language version warnings
To be used in the project after bootstrap to get rid of warnings like
"Language version 1.3 is deprecated, ..." which prevent us from enabling
`-Werror` in `:compiler:cli` and other modules.
2021-02-03 13:07:04 +01:00
Alexander Udalov 99b5e5a373 Deprecate JVM target 1.6
#KT-44650 Fixed
2021-02-03 12:50:52 +01:00
Dmitry Petrov ab20a8ffff JVM_IR indy-lambdas: minor updates and fixes
KT-44278 KT-26060 KT-42621
2021-02-03 14:16:25 +03:00
Dmitry Petrov d94912ed62 JVM_IR indy-lambdas: initial implementation and tests
KT-44278 KT-26060 KT-42621
2021-02-03 14:16:22 +03:00
scaventz bd205317aa CLI: improve behavior of -include-runtime
1.fix KT-17344: Include kotlin-reflect to resulting jar if "-include-runtime" is specified, unless the -no-reflect option is specified.
2.fix KT-43220: -include-runtime should add .kotlin_builtins to the output
2021-02-02 12:49:23 -08:00
Anton Bannykh f42f2fa743 JS DCE: disable logging by default
Based on Vladislav Saifulin's PR #4031
2021-02-02 18:38:50 +03:00
Anton Bannykh bbc6d2b993 JS DCE: use less LinkedHashSets 2021-02-02 18:38:49 +03:00
Marcin Aman d953a03807 Specify type explicitly in KotlinCoreProjectEnvironment.createCoreFileManager to allow overriding this method with different implementation 2021-02-02 05:26:04 -08:00
Roman Artemev 9fa5feeeea [CLI] Provide MessageCollector based logger for IR from CLI 2021-02-02 12:05:35 +03:00
Roman Artemev bb66b2fd04 Drop redundant compile dependency 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
Igor Yakovlev 5d4606daaa [FIR IDE] Remove LightClassProvider 2021-02-01 21:21:02 +03:00
Alexander Udalov adfa8c788c Light classes: use JVM target from the module
Using "JVM_1_8" always resulted in incorrect mapping of Kotlin
annotation targets to Java element types.

The change in AbstractKotlinRenderLogTest is needed because while
CliTraceHolder.module is technically a descriptor leak, it was never
detected by this test accidentally, because of the depth cutoff equal to
10, which started to not be enough after the minor refactoring of
replacing `Delegates.notNull` with `lateinit`.
2021-02-01 11:54:05 +01:00
Alexander Udalov d022bb0248 Switch default JVM target to 1.8
#KT-29405 Fixed
2021-02-01 11:54:04 +01:00
Alexander Udalov f08733eb75 CLI: suppress warning on JDK 9+ with illegal access to ResourceBundle
The underlying issue is tracked in IDEA-248785.

 #KT-43704 Fixed
2021-01-29 21:29:08 +01:00
Alexander Udalov 2ef4ca4e6e CLI: do not pass -noverify to java process starting from JDK 13
#KT-44232 Fixed
2021-01-29 21:28:25 +01:00
Alexander Udalov 2bbe3db041 Update copyrights in CLI scripts 2021-01-29 21:27:28 +01:00
Dmitriy Novozhilov 0769157a16 Revert "Revert "Build: enable -Werror in stdlib/core/compiler/plugins modules""
This reverts commit 1300ec3e
2021-01-29 14:57:08 +03:00
Dmitry Petrov 3140cca050 JVM_IR indy-SAM conversions, 1st passing tests
KT-44278 KT-26060 KT-42621
2021-01-29 12:59:45 +03:00
Dmitriy Novozhilov 1300ec3e45 Revert "Build: enable -Werror in stdlib/core/compiler/plugins modules"
This reverts commit 3be62dfc
2021-01-28 13:19:34 +03:00
Roman Artemev 37c7f60ae7 [KLIB] Fix issues between directory and .klib modes
- use .klib extension explicitly
 - fix issue with `module.klib.klib` names
2021-01-26 19:23:23 +03:00
Roman Artemev 2daf0cc11c [JS IR] Support additional repositories in CLI (cli part) 2021-01-26 19:23:22 +03:00
Roman Artemev cd9e341fa9 [JS IR] Support additional repositories in CLI (compiler part) 2021-01-26 19:23:22 +03:00