Commit Graph

2919 Commits

Author SHA1 Message Date
Ivan Kochurkin 1827df82c4 Removed useless as casts from compiler code
It allows compiling code with K2 and enabled `-Werror`
2023-10-24 20:59:56 +00:00
Troels Bjerre Lund 3556533d95 [K/N] Fix K2 detection in native tests
This updates how the requested language version is detected in native
tests, after language version 2 has become the default.
2023-10-24 14:00:34 +00:00
Matt Groth 80257dc58f Remove print statement
This print statement should either be delated, as I did here, or if it must be kept should be properly logged at an INFO level so that gradle builds that are at the WARN level do not see this.
2023-10-24 11:16:32 +00:00
cristiangarcia 03ad981dea Make ClangFrontend cacheable
Co-authored-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>


Merge-request: KT-MR-11479
Merged-by: Cristian Garcia <Cristian.Garcia-Marin@jetbrains.com>
2023-10-24 09:50:02 +00:00
Alexander Shabalin b3e13fb2c2 [K/N] Migrate runtime/collections tests to new testing infra ^KT-61259 2023-10-24 09:27:46 +00:00
Dmitrii Krasnov 10a6d8fd2c [Gradle IT] Added configuration for running IT with k/n from master
[Gradle] Updated kotlin-build-gradle-plugin to 0.0.40

#KT-45978 Ready for Review


Merge-request: KT-MR-12509
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-10-24 08:38:51 +00:00
Alexander Udalov b5ba9ee671 IR: refactor resolveFakeOverride call sites
Split it to 4 functions for clarity: resolveFakeOverride,
resolveFakeOverrideOrFail, resolveFakeOverrideMaybeAbstract,
resolveFakeOverrideMaybeAbstractOrFail. Remove/inline duplicated
utilities and remove unused parameters.
2023-10-23 23:38:47 +00:00
cristiangarcia cc2280a146 Make KonanCompileLibraryTask cacheable
Merge-request: KT-MR-11117
Merged-by: Cristian Garcia <Cristian.Garcia-Marin@jetbrains.com>
2023-10-23 16:55:14 +00:00
Vladimir Sukharev e43b634122 [K/N] Migrate most simple filecheck tests to new infra
^KT-62157


Merge-request: KT-MR-12376
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-10-23 10:07:28 +00:00
Nikita Bobko 14029b0ebc [STDLIB] 1/2 Drop AllowDifferentMembersInActual from stdlib
^KT-62656 Fixed

I blindly converted all `@AllowDifferentMembersInActual` to suppresses.
But some suppresses in stdlib are redundant. I'm too lazy properly
annotate only the necessary places. All these suppresses will go away
after the bootstrap update anyway

I drop allowDifferentMembersInActual_class and
allowDifferentMembersInActual_typealias tests because their only purpose
was to check that `@AllowDifferentMembersInActual` works as expected

Note: some tests are failing in the compiler because of that. I will fix
them in the next commit
2023-10-20 14:37:09 +00:00
Mads Ager bdfb3c3ac9 [Native] Move remaining usages for LLVMBuildLoad to LLVMBuildLoad2.
Step towards LLVM opaque pointers.
2023-10-20 06:07:41 +00:00
Mads Ager 5b9a4b289f [Native] Fix tailrec test.
tailrec is no longer allowed on open functions but this test is
still using it.
2023-10-20 06:07:41 +00:00
Mads Ager 72ddd4b78d [Native] Use LLVMBuildLoad2 instead of LLVMBuildLoad.
This is a first step in the move from typed to opaque pointers.
2023-10-20 06:07:40 +00:00
Alexander Shabalin e4b34857c0 [K/N] Fix FrameworkTest with compileOnlyTests. 2023-10-19 21:48:33 +00:00
Igor Chevdar eb6db02649 Revert "[Native] Use LLVMBuildLoad2 instead of LLVMBuildLoad."
This reverts commit a487ec1889.
2023-10-19 12:57:25 +00:00
Igor Chevdar 254b5b1934 Revert "[Native] Fix tailrec test."
This reverts commit 67c501e0b6.
2023-10-19 12:57:24 +00:00
Igor Chevdar d5001fb7dd Revert "[Native] Move remaining usages for LLVMBuildLoad to LLVMBuildLoad2."
This reverts commit 4e66881549.
2023-10-19 12:57:24 +00:00
Pavel Punegov ff89fb8405 [K/N][build] Lazy task configuration in the tests 2023-10-19 12:12:02 +00:00
Pavel Punegov e01cea6669 [K/N][build] Add providers to klib install and cache tasks 2023-10-19 12:12:02 +00:00
Pavel Punegov b1a85d45c6 [K/N][build] Move old Konan plugin to native-build-tools 2023-10-19 12:12:02 +00:00
Pavel Kunyavskiy ad5831acc6 [IR] Add a method to get ModuleDescriptor from IrPackageFragment
Ideally, instead of this method, there should be a link
to IrModuleFragment. Unfortunately, it would require to big refactoring,
as some of IrPackageFragment implementations doesn't have any
IrModuleFragment inside, and are not located inside any
IrModuleFragment.

So for now, we just implement and use everywhere a single way of
getting the module descriptor, which respects a IrModuleFragment
link if it exists, and fallbacks to descriptor-based method
if it doesn't.

^KT-62623
2023-10-19 10:16:44 +00:00
Mads Ager 4e66881549 [Native] Move remaining usages for LLVMBuildLoad to LLVMBuildLoad2.
Step towards LLVM opaque pointers.
2023-10-19 07:54:30 +00:00
Mads Ager 67c501e0b6 [Native] Fix tailrec test.
tailrec is no longer allowed on open functions but this test is
still using it.
2023-10-19 07:54:30 +00:00
Mads Ager a487ec1889 [Native] Use LLVMBuildLoad2 instead of LLVMBuildLoad.
This is a first step in the move from typed to opaque pointers.
2023-10-19 07:54:30 +00:00
Alexander Shabalin 4922223bec [K/N] Refactor :kotlin-native:dependencies
Move K/N dependencies handling logic into gradle plugins:

`NativeDependenciesDownloader` is instantiated in
`:kotlin-native:dependencies` and provides a single configuration that
contains all directories with the dependencies. The configuration has
a variant for each target.

`NativeDependencies` is instantiated by projects that require native
dependencies (i.e. previously used to depend on
`:kotlin-native:dependencies:update`). This plugin creates a configuration
that by default depends on `:kotlin-native:dependencies`. Its extension
provides `llvmDependency`, `libffiDependency`, `hostPlatformDependency`,
`targetDependency()` to depend on the parts needed for the project and
provides accessors `llvmPath`, `libffiPath`, `hostPlatform` that are
safe to use during configuration time, but which do not automatically
resolve those dependencies.

`llvmDir`, `*LibffiDir` properties on `:kotlin-native` are removed
completely, as their use is replaced by `NativeDependencies`. As a
consequence, `evaluationDependsOn(":kotlin-native:dependencies")` is
also gone.

All direct dependencies on `:kotlin-native:dependencies:update` are
replaced with dependencies on specific parts via `NativeDependencies`
2023-10-18 10:53:12 +00:00
Dmitriy Novozhilov 704e2ef5c5 Suppress K2 specific warnings in the codebase
^KT-62472
2023-10-18 07:59:27 +00:00
Alexander Shabalin 83435ccde1 [K/N] Remove workaround in FrameworkTest for old macOS
In macOS prior to 10.14.4 we needed to specify the location of
libswiftCore.dylib. That OS version is long unsupported, so we can
drop the code.
2023-10-17 16:54:34 +00:00
Alexander Shabalin 004ef267c5 [K/N] Remove check for bitcode embedding ^KT-61875
This removes the check in old testing infra for FrameworkTest.
2023-10-17 16:54:34 +00:00
Alexander Shabalin 27c85a059f [K/N] Move memmem from Porting.h to KString.cpp ^KT-59008 2023-10-17 09:37:34 +00:00
Ivan Kylchik 350ee4be1d [Native] Replace consequence line and column calls with a single one 2023-10-13 08:50:47 +00:00
Pavel Kunyavskiy 156c341eeb [K/N] Implement objc overridablity condition for IR
^KT-61511
2023-10-13 08:15:01 +00:00
Svyatoslav Scherbina a318cd455d Native: fix interop_concurrentRuntime test for mingw_x64
Our sysroot for mingw_x64 still requires -femulated-tls. For C++ code
as well. Without it the test fails with

    lld-link: error: undefined symbol: std::__once_call

^KT-46612
2023-10-12 17:16:18 +00:00
Svyatoslav Scherbina 080a404d9a Native: enable interop_concurrentRuntime test since it no longer fails
^KT-43180 Obsolete
2023-10-12 17:16:18 +00:00
Svyatoslav Scherbina 2db89b7e7a Native: improve description of supported MSVC versions in README 2023-10-12 17:06:56 +00:00
Igor Chevdar 6c519488a6 [IR] Reworked K/N variables inliner hint 2023-10-11 06:27:02 +00:00
Dave MacLachlan c820e82db3 Native: remove linker warning when building libllvmstubs
Building with macOS gave the linker warning
`ld: warning: ignoring duplicate libraries: '/Users/foo/.konan/dependencies/apple-llvm-20200714-macos-aarch64-1/lib/libclangEdit.a'`

Remove duplication from the build script to get rid of the warning.

Co-authored-by: Dave MacLachlan <dmaclach@gmail.com>
2023-10-09 16:49:16 +00:00
Pavel Kunyavskiy a561a8e531 [K/N] Improve the exception message in code generator exceptions
^KT-62335
2023-10-06 11:39:03 +00:00
Vladimir Sukharev e342d7ff66 [K/N] Revert language version override for uikit sample
^KT-62262
2023-10-05 14:37:13 +00:00
Vladimir Sukharev 520983d52c [K/N] Add failing test for KT-62262: NPE compiling uikit sample
^KT-62262
2023-10-05 14:37:13 +00:00
Troels Bjerre Lund f2fb237212 [K/N] Lower amount of finalization in stress test 2023-10-05 13:18:20 +00:00
Troels Bjerre Lund 239f3a30cb [K/N] Add flag to disable allocator overhead estimate 2023-10-05 13:18:20 +00:00
Troels Bjerre Lund 3ae7b790a9 [K/N] Update HeapTest
This adds TypeInfo to the objects allocated in HeapTest, which is now
needed by SweepObject to gather problem live set statistics.
2023-10-05 13:18:20 +00:00
Alexander Shabalin 2a41b80373 [K/N] Make stress_gc_allocations tests more useful ^KT-61914 2023-10-05 13:18:20 +00:00
Troels Bjerre Lund bb195749c8 [K/N] Re-enable mutator assist
Also remove disabling of GC scheduling during GC
2023-10-05 13:18:20 +00:00
Troels Bjerre Lund a752d5d000 [K/N] Estimate allocator overhead
This increases the boundary for the next GC scheduling by how much is
estimated is currently being wasted by the allocator due to paging. This
is necessary, since the gc scheduling boundary is set based on the size
of the live set at the last GC, while the current memory use is only
tracked in whole allocator pages. This patch avoids some of the
situations where the GC would be triggered again immediately upon
completion, which happens with many sparsely filled pages.
2023-10-05 13:18:20 +00:00
Troels Bjerre Lund fc13dbdb91 [K/N] Track live size on sweep
After the change to track allocations in big chunks (KT-57773), the
scheduler no longer had information about how much of the allocated
memory was used on live objects, which lead to a lot of extra memory
usage (KT-61914). This patch adds the tracking of live objects size to
sweeping, which is enough to mitigate the problem.

co-authored by Alexander Shabalin

^KT-61914
2023-10-05 13:18:20 +00:00
Svyatoslav Scherbina e22d9821e2 Native: fix kotlin-native/performance/framework build script for K2
The build script manually specifies which directories are parts of
which source sets. And it did that wrong: all directories were just
added to the nativeMain source set.
This was an incorrect configuration (matching expect and actual were
getting into the same source set), and K2 compiler was not really happy
with that.

This commit fixes the correspondence between source sets and source
directories in kotlin-native/performance/framework build script, thus
fixes the build for that benchmark with K2.
2023-10-05 09:17:58 +00:00
Svyatoslav Scherbina 4672727bd6 Native: enable K2 for benchmarks in performance/
Those benchmarks are built with bootstrap KGP and snapshot compiler.
Currently the former is K1, while the latter is K2. As a result, the
build fails because K2 compiler needs -Xfragment-sources argument,
while K1 uses -Xcommon-sources. So KGP passes the latter, while the
compiler expects the former.

Fix this by forcing KGP to use K2 for benchmarks in performance/
This can be reverted once bootstrap is updated to 2.0.0.
2023-10-05 09:17:58 +00:00
Vladimir Sukharev cd4c241fa3 [K/N] Run irText tests for K2/Native
^KT-58240
2023-10-04 18:20:05 +00:00
vishwajeet.barve 28fabf06fc Native: update README to reflect that build time depends on system configuration (#5189)
Co-authored-by: vishwajeet.barve <vishtech36@gmail.com>
2023-10-04 14:59:54 +00:00