Commit Graph

3282 Commits

Author SHA1 Message Date
Ivan Kylchik e1180adfbd [Native] Always cast expression to the expected type after inline
Right now, during the process of inlining, the compiler erases types.
Because of that, we can end up with some random type
(for example, `Any`) where the concrete type was
expected (for example, `Int`). Compiler must insert a cast in the
required places.

#KT-66017 Fixed
2024-03-12 08:19:50 +00:00
Dmitriy Novozhilov d352cc9d96 [Frontend] Make DiagnosticSuppressor a project-level extension
Originally it was an application-level component, which caused non-trivial
  logic and cognitive load to carefully handle those extensions to avoid
  memory leaks.

6740a596 introduced a way to easily register `DiagnosticSuppressor` to
  project, and this commit continues this work, making it a proper
  project-level extension

A lot of changes caused by the fact, that this extension is needed to be
  obtained from `BindingContext` (see `BindingContextSuppressCache` and
  its usages), so almost all changes are introducing `Project` to
  `BindingContext`

^KT-66449 Fixed
2024-03-12 06:43:58 +00:00
Ilya Gorbunov dee9fdc02d [stdlib] Regenerate sources 2024-03-11 18:12:27 +00:00
Bogdan Mukvich c6aac835e5 Update SPDX gradle plugin
* fixes SPDX Gradle plugin to be used with configuration cache
* allows removing output workaround for multimodule builds

KTI-1427
2024-03-11 14:22:06 +00:00
Alexander Udalov 1d38c01afc IR: remove some usages of deepCopyWithVariables
At this point, `deepCopyWithVariables` is the same as
`deepCopyWithSymbols` except that the former doesn't call
`patchDeclarationParents`, which most likely produces incorrect IR in
some call sites.
2024-03-11 11:49:10 +00:00
Alexander Udalov e7e8cba1b4 IR: slightly simplify deep copy interface
Do not pass TypeRemapper explicitly unless an instance of something
other than DeepCopyTypeRemapper is required.
2024-03-11 11:49:10 +00:00
Wojciech Litewka e9005e4fed [IR] Initialize IrFunction.returnType eagerly, when possible 2024-03-11 09:07:54 +00:00
Wojciech Litewka d1e8016ab2 [IR] Pass null instead of IrUninitializedType to IrFactory
#KT-66053 In progress
2024-03-11 09:07:54 +00:00
Wojciech Litewka 943be239ee [IR] Simplify IrFileImpl and IrExternalPackageFragment
#KT-65773 In Progress
2024-03-07 14:32:31 +00:00
Igor Chevdar 6c691b497a [K/N] Added a benchmark on string array loop 2024-03-06 06:14:18 +00:00
Igor Chevdar 27a4cb6c12 [K/N][IR] Fixed wrong type in IR around enums 2024-03-06 05:21:32 +00:00
Igor Chevdar 17d79dafb1 [K/N][IR] Fixed wrong type in IR around ImmutableBlob 2024-03-06 05:21:31 +00:00
Igor Chevdar faf5a7fecc [K/N] Handle conservative type approximations in functional types
Sometimes FE resolves type as an intersection type which gets approximated to Nothing
(as a part of a functional type for function references), this commit tries to workaround
this by getting this type from the referenced function
2024-03-06 05:21:31 +00:00
Alexander Shabalin e8202c3355 [K/N] Simplify dependencies around kotlin-native/ 2024-03-05 21:47:43 +00:00
Alexander Shabalin 24ede14e37 [K/N] Convert :kotlin-native:backend.native buildscript to kts
Use folder structure from the rest of the project and build it by
the bootstrap compiler.
2024-03-05 21:47:43 +00:00
Alexander Shabalin 0542b62430 [K/N] Extract :native:cli-native from kotlin-native/backend.native/cli.bc 2024-03-05 21:47:43 +00:00
Alexander Shabalin bce550dce4 [K/N] Move llvm interop generation to kotlin-native/llvmInterop/ 2024-03-05 21:47:43 +00:00
Alexander Shabalin ab62632a85 [K/N] Move files, env interop generation to kotlin-native/common/ 2024-03-05 21:47:43 +00:00
Alexander Shabalin 9f0a6537bb [K/N] Convert :kotlin-native:Interop:StubGenerator
Use folder structure from the rest of the project and build it by
the bootstrap compiler.
2024-03-05 21:47:43 +00:00
Alexander Shabalin d7bccaef42 [K/N] Convert :kotlin-native:Interop:Skia buildscript to kts
Use folder structure from the rest of the project and build it by
the bootstrap compiler.
2024-03-05 21:47:43 +00:00
Alexander Shabalin 3a5f33e9cd [K/N] Convert :kotlin-native:klib
Use folder structure from the rest of the project and build it by
the bootstrap compiler.
2024-03-05 21:47:43 +00:00
Alexander Shabalin ec8bc6a64f [K/N] Convert :kotlin-native:utilities:cli-runner buildscript to kts
Use folder structure from the rest of the project and build it by
the bootstrap compiler.
2024-03-05 21:47:43 +00:00
cristiangarcia 540df2944b XcodeValueSource needs to return a Serializable object
Required for KTI-1553
2024-03-05 18:52:33 +00:00
Timofey Solonin 737ad3cde6 Specify broken macros in legacy testing infrastructure
^KT-65542
2024-03-05 12:15:29 +00:00
Alexander Shabalin ce68a1a276 [K/N][tests] Remove native unit tests from old infra ^KTI-1571 2024-03-05 12:10:32 +00:00
cristiangarcia 57edc413a3 Make native tasks CC compatible
This allows running with CC&native:
./gradlew assemble
./gradlew :kotlin-native:bundle
./gradlew :native:native.tests:test

Required for KTI-1553
2024-03-05 11:22:20 +00:00
Alexander Shabalin 4e6451c25e [K/N] Use @Escapes for all external funs with escaping arguments 2024-03-04 21:04:04 +00:00
Alexander Shabalin 8d81fd6647 [K/N] Include frameworks via umbrella headers only ^KT-65409 2024-03-04 20:53:05 +00:00
Ilya Gorbunov 35bca103eb [stdlib-mpp] Single dependency on stdlib in commonMain
In this project it's required to declare stdlib dependency explicitly,
but now it can be a single line in commonMain
2024-03-04 11:40:06 +00:00
Ilya Gorbunov 16e61f978c [stdlib-mpp] remove some kotlin-stdlib-common artifact deps 2024-03-04 11:40:06 +00:00
Vladimir Sukharev 4d723bfa85 [K/N][Tests] Migrate test kt63243
^KT-61259
2024-03-01 11:38:49 +00:00
Alexander Udalov f98a22e8e4 Fir2Ir: enable IR-based fake override builder
Invert the logic of IR/FIR2IR-based generators: change the CLI argument
to -Xuse-fir-fake-override-builder, test directive to
USE_FIR_BASED_FAKE_OVERRIDE_GENERATOR, etc.

The changes in test data caused by using IR fake override builder by
default are in the subsequent commit.

 #KT-61514
2024-02-29 10:14:31 +00:00
Alexander Shabalin 5c2017fa5f [K/N] Fix CC in Xcode usage ^KTI-1553
- Perform all calls to xcrun in XcodeValueSource.
- Use the fully computed Xcode instance as the current Xcode instance.
- Hide all of this inside a Gradle plugin and apply it to kotlin-native
  project.
2024-02-28 17:58:41 +00:00
Wojciech Litewka 2a5b4ae652 [IR] Remove files parameter from IrModuleFragmentImpl
This commit removes the default parameter in constructor,
as well as custom logic in this class, which would
make it harder for its subsequent auto-generation.

^KT-65773 In Progress
2024-02-28 09:29:56 +00:00
Abduqodiri Qurbonzoda 0811a5b77b Promote enumEntries() to stable #KT-65532 2024-02-27 19:49:12 +00:00
Aleksei.Glushko 69127b4483 [K/N] Exapnd concurrent part of the GC mark phase (KT-58865)
* Build mark closure completely concurrent.
    * Reintroduce concurrent weak processing.
    * Request the second STW only to preare the heap for sweeping.
2024-02-27 18:55:31 +00:00
Aleksei.Glushko b7067e0980 [K/N] ExtraSafePointActionActivator to be used in concurrnt mark 2024-02-27 18:55:31 +00:00
Aleksei.Glushko 728e9a5811 [K/N] OnceComputable C++ utility class 2024-02-27 18:55:31 +00:00
Ivan Kylchik 98dba48fde [Native] Simplify AssertRemovalLowering 2024-02-27 17:41:33 +00:00
Alexander Shabalin ac6aad1f65 [K/N][tests] Do not run objcexport-header-generator in backend.native:tests ^KTI-1571 2024-02-27 12:24:36 +00:00
cristiangarcia e83d2e31d4 Fix CompileToBitcodePlugin onlyIf to make it CC compatible
Required for KTI-1553
2024-02-27 10:32:58 +00:00
Vyacheslav Gerasimov 8fd3166199 Build: Remove coroutines-core dependency from backend.native:tests
The dependency on kotlinx-coroutines-core seems redundant and always
overridden by another dependency.
2024-02-27 10:29:59 +00:00
Vyacheslav Gerasimov f924de5a2c Build: Remove unused dependencies on :kotlin-compiler project
#KTI-1598
2024-02-27 10:29:59 +00:00
Alexander Shabalin edf05b69ac [K/N][performance] Fix build 2024-02-26 18:06:44 +00:00
Alexander Shabalin b1f59e5f0d [K/N] Make NativeDependenciesDownloader compatible with CC ^KTI-1553 2024-02-26 14:53:23 +00:00
Artem Olkov dd9332d9e1 Add kotlin runtime modulemap for swift export as part of kotlin-native dist #KT-65673 fixed
Co-authored-by: Alexander Shabalin <alexander.shabalin@ashabalin.me>

Merge-request: KT-MR-14493
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-26 12:51:57 +00:00
Abduqodiri Qurbonzoda 31aa71dd6a Promote Common String.toCharArray(destination) to stable #KT-65532 2024-02-26 10:48:29 +00:00
Ilya Gorbunov 85854a6b8d [stdlib] Make enumEntriesIntrinsic not reified/inline
It's required to simplify the corresponding backends' inliners.

KT-59712, KT-59713
2024-02-23 05:50:37 +00:00
Dmitriy Dolovov 5e81850bb1 [KLIB tool] Don't sort declarations in "dump-metadata" command
Instead, let the command print declarations in the program order.
Do sorting only in special "test mode".

^KT-62340
2024-02-22 22:21:30 +00:00
Alexander Shabalin c600b74459 [K/N][tests] Restore ir_providers/hello.kt ^KTI-1597 2024-02-22 14:56:13 +00:00