Commit Graph

2242 Commits

Author SHA1 Message Date
Pavel Punegov 45637c1b94 [K/N][build] Make build-tools to be able to build as a project
* Replace and fix project dependencies in build-tools
* Add Gradle annotations for tasks
2023-02-27 10:48:26 +00:00
Pavel Punegov dcc5c7e435 [K/N][build] Fix shared project to use projects directly 2023-02-27 10:48:25 +00:00
Pavel Punegov 931f7192a0 [K/N][build] Build scripts cleanup
* Removes unused dependencies
* Cleanup code
* Remove benchmark related sources
2023-02-27 10:48:25 +00:00
Pavel Punegov 71f2c3cf9b [K/N][perf] Move benchmarks related code to performance subdir 2023-02-27 10:48:25 +00:00
Igor Chevdar 0f384f5878 [K/N][IR] Workaround for off-scope type parameters
#KT-56500 Fixed
2023-02-23 15:32:25 +00:00
Vladimir Sukharev 7c9e567496 [K2/N] KT-56028: Enable and patch test interop_kt49034_objcclass
Merge-request: KT-MR-8942
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-23 13:08:33 +00:00
Svyatoslav Scherbina 22ee170f44 [K2/N] Prohibit single-stage compilation with language version 2.0
Kotlin/Native compiler can compile source files directly to a native
binary (e.g. an executable or a framework). This is the so-called
"single-stage" compilation mode. It is used only in the command-line
compiler, while Kotlin Gradle plugin always produces an intermediate
klib first, and then compiles it to a native binary ("two-stage"
compilation mode).

When running Kotlin/Native compiler with '-language-version 2.0' in the
single-stage compilation mode, it in fact doesn't use the new K2
frontend. This is misleading and error-prone.

To address this problem, the commit prohibits the single-stage
compilation with '-language-version 2.0'. This affects only the
command-line compiler, and shouldn't affect compilation with Gradle.

^KT-56855
2023-02-23 11:36:38 +00:00
Pavel Kunyavskiy b306ed53aa [K/N] Support Enum entries in objc export
^KT-53653
2023-02-23 10:49:25 +00:00
Pavel Kunyavskiy b4bd847345 [K/N] Refactor ObjcExportTest build script 2023-02-23 10:49:25 +00:00
Vladimir Dolzhenko 3e99807436 Add ability to provide specific AbsentDescriptorHandler
#EA-457188

Merge-request: KT-MR-8900
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-02-22 12:44:46 +00:00
Pavel Punegov 9ea299b0e7 [K/N][build] Fix Native plugin: remove archive file before adding
Merge-request: KT-MR-8783
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-02-17 11:28:41 +00:00
Dmitriy Novozhilov 79e4df72bf [CLI] Introduce utilities for creating FirSession hierarchy in CLI for all platforms
Also support session creation and compilation for HMPP projects

^KT-56209 Fixed
2023-02-17 11:08:51 +00:00
Dmitriy Novozhilov d4bb740a62 [CLI] Store information about HMPP module for source files 2023-02-17 11:08:50 +00:00
Svyatoslav Scherbina 72f9cdf49b Native: fix curl sample test
Don't publish libcurl to a local Maven repo, but consume it directly
as a project dependency.

Publishing appears to be fragile here, and the intention of the test
does not involve checking Gradle anyway.
2023-02-17 10:35:02 +00:00
Pavel Punegov 83d1de56bf [K/N][build] Add coroutines dependency for bootstrap test
Bootstrap test builds compileKotlin that fails to resolve
coroutines.
2023-02-16 11:56:35 +00:00
Pavel Punegov cc258934c4 [K/N][build] Cleanup obsolete build tasks
* Remove obsolete reporting
* Remove old build tasks: BuildPusher and CollisionDetector
* Gradle build file cleanup
* Remove old wrappers

Merge-request: KT-MR-8788
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
(cherry picked from commit a9cae3fe87)
2023-02-16 11:56:34 +00:00
Vladimir Sukharev b61a02db73 [K/N] Update degrade script
Merge-request: KT-MR-8690
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-15 14:06:52 +00:00
Igor Chevdar 564b40f05d [K/N] Fixed resolve order of compiler caches
#KT-56611 Fixed
2023-02-15 07:06:05 +00:00
Vladimir Sukharev 3124154aef [K2/N] Fix false negative interop_objc_kt55938 under K2
Merge-request: KT-MR-8817
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-14 20:32:45 +00:00
Vladimir Sukharev 255d4fa829 [K/N] Don't reuse irGet node in cleanerField tree
Merge-request: KT-MR-8831
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-14 20:31:13 +00:00
Pavel Kunyavskiy 00c900cb49 [K/N] Optimize code generation for function references
In before, each function reference created 5 functions needed only
for equals/hashcode properties. It contributed arround 3.5% of code size
on several sample projects. This is now replaced by passing constant
object to base class constructor.
2023-02-14 13:00:47 +00:00
Nikolay Krasko 2ad567e14c Revert "[K/N][build] Cleanup obsolete build tasks"
This reverts commit a9cae3fe87.
2023-02-14 11:30:17 +00:00
Igor Chevdar ba172358d8 [K/N] Option to specify IR validation severity 2023-02-14 07:30:47 +00:00
Igor Chevdar 4fd063bd4b [K/N][driver] Some tweaks in IrValidator setup 2023-02-14 07:30:46 +00:00
Igor Chevdar 95c4ded9d0 [K/N][IR] Fixed wrong IrCall type (to fix IR validation) 2023-02-14 07:30:46 +00:00
Igor Chevdar 750bb5c8c4 [K/N][IR] Added proper parent 2023-02-14 07:30:44 +00:00
Pavel Punegov a9cae3fe87 [K/N][build] Cleanup obsolete build tasks
* Remove obsolete reporting
* Remove old build tasks: BuildPusher and CollisionDetector
* Gradle build file cleanup
* Remove old wrappers

Merge-request: KT-MR-8788
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-02-13 14:02:28 +00:00
Svyatoslav Scherbina f78ffcb300 [K2/N] Unignore three tests fixed by basic forward declarations support
These tests got fixed by b19058c.

^KT-56028
2023-02-13 10:01:12 +00:00
Svyatoslav Scherbina 1c5335302d [K2/N] Unignore mistakenly ignored testValuesGenericsFramework 2023-02-13 10:01:12 +00:00
Vladimir Sukharev 7bce6d21f0 Disable in K2 tests that fail for two-stage
Merge-request: KT-MR-8786
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-10 16:59:25 +00:00
Stanislav Erokhin bec9ad0f6b Minor. Rename FunctionClassDescriptor#functionKind -> functionTypeKind
This commit is needed for the following commit.
There we will restore the compatibility API with Android IDEA plugin
2023-02-10 16:01:04 +00:00
Igor Chevdar a14f3c8cc2 [K/N] Fixed wrong initializer call extraction for interop-visible functions
#KT-56521 Fixed
2023-02-10 15:45:11 +00:00
Igor Chevdar 2281d9700d [K/N] Added a test for #KT-56521 2023-02-10 15:45:10 +00:00
Pavel Kunyavskiy c400a75407 [K/N] Fix tests failing because of phase renaming 2023-02-10 12:58:22 +00:00
Vladimir Sukharev 6e434748d1 [K2/N] Run new stdlib tests also for K2.
Merge-request: KT-MR-8708
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-10 10:34:44 +00:00
Sergey Bogolepov f86d28449f [K/N] Make -Xprofile-phases print profile of LLVM passes 2023-02-10 10:20:30 +00:00
Sergey Bogolepov 637258e175 [K/N] Add LLVM C wrappers for -time-passes API. 2023-02-10 10:20:29 +00:00
Pavel Kunyavskiy 120ca08740 [K/N] Rework LLVM pipeline
Compiler was running LTO pipeline without preliminary running normal
optimisation pipeline. In some cases this lead to unacceptably long
compilation.

Also, this allows disabling LTO pipeline part, having still quite
good performance, but much better compilation time.

Co-authored-by: Johan Bay <jobay@google.com>

^KT-55868
2023-02-09 14:30:39 +00:00
Sergey Bogolepov f7d3312ad5 [K/N] Finish refactoring TempFiles usages
1. Introduce CExportFiles class
This class aggregates all files that are created specifically for
C export. Adding more such classes for other output kinds should
help getting rid of OutputFiles class.

2. Remove NativeGenerationState.tempFiles
Making NativeGenerationState (and compiler phases in general)
unaware of files and their lifetime is necessary for making phases
simpler and easier to compose.
2023-02-09 08:20:34 +00:00
Sergey Bogolepov 4fbddf1786 [K/N] Pass NativeGenerationState components as parameters
tempFiles is finally moved to the driver.
2023-02-09 08:20:34 +00:00
Sergey Bogolepov b7b85177a7 [K/N] Refactor module splitting for backend
We want to extract tempFiles from NativeGenerationState.
To do so, we need to move creation of NativeGenerationState from
`splitIntoFragments` function and untie CacheLlvmModuleSpecification
from NativeGenerationState
2023-02-09 08:20:34 +00:00
Sergey Bogolepov eba1b4c388 [K/N] Untie DependenciesTracker from NativeGenerationState 2023-02-09 08:20:33 +00:00
Sergey Bogolepov 7402ef24bb [K/N] Remove obsolete TempFiles constructor parameter 2023-02-09 08:20:33 +00:00
Sergey Bogolepov 6a06be08cd [K/N] Extract pre-link from linker and a bit of refactoring
Finish extracting all usages of TempFiles to the driver.
2023-02-09 08:20:32 +00:00
Sergey Bogolepov e6081e5851 [K/N] Extract cache management in linker to a separate file
Also, more meaningful names.
2023-02-09 08:20:32 +00:00
Sergey Bogolepov 2f1e9844df [K/N] Move temp file from BitcodeCompiler to the driver
Continue extracting all temporary files to the driver, so we have
a better control over them. For example, this allows creating of a new
driver where pipeline split between multiple compiler invocations.
2023-02-09 08:20:31 +00:00
Sergey Bogolepov a11be433e2 [K/N] Get rid of predefined values in TempFiles
One step closer to getting rid of this class at all.
2023-02-09 08:20:31 +00:00
Sergey Bogolepov 1182903b20 [K/N] Move c++ adapter compilation to a separate phase
Besides purely architectural reasons or, rather, as a
direct effect of those, it allows moving tempFiles usages
to the driver.
2023-02-09 08:20:30 +00:00
Sergey Bogolepov bb1feabb79 [K/N] Untie C header generation from NativeGenerationState 2023-02-09 08:20:29 +00:00
Sergey Bogolepov 8516ae2b72 [K/N] Extract C header generation to a separate phase 2023-02-09 08:20:29 +00:00