Commit Graph

95257 Commits

Author SHA1 Message Date
Sergey Bogolepov d7fff3ca01 [K/N] Add -Xforce-compiler-driver=(static, dynamic) flag
Useful for development purposes when one wants to compare
the outputs of different drivers.
2022-10-06 13:10:50 +00:00
Sergey Bogolepov 6ef4277d89 [K/N] Introduce multiple compiler drivers
We want to move from current compilation pipeline
that is defined in TopLevelPhases.kt to a "dynamic" one.
The main drawback of the current one is that it is built
around single Context, single IR module, single compiler output, etc.
It is now as flexible as Kotlin/Native compiler requires.
For example, it is pretty hard to support multiple Apple frameworks
or a proper separate compilation.
To mitigate this problem, we are going to move to a new "dynamic"
compiler pipeline that relies on an explicit data passing between
different compiler phases. For example, it allows to use single phase
output as an input for multiple independent subsequent phases. Or
vice versa, e.g. use outputs of multiple "produce object file" phases by
a single linker phase.

This commit introduces `CompilerDriver` hierarchy which is required
during transition period.
2022-10-06 13:10:50 +00:00
Alexander Korepanov 89d3060e00 [JS IR] Drop unused JsRecordExtractedLocalClasses logic 2022-10-06 11:56:06 +00:00
Alexander Korepanov 86c72a5b9e [JS IR] Drop unused all export collecting logic 2022-10-06 11:56:06 +00:00
Steven Schäfer 93bf54266a FIR: Implement moduleDescriptor in Fir2IrPluginContext
A ModuleDescriptor is needed to create external package fragments with
descriptors (see JvmSymbols.kt). Descriptorless external package
fragments can fail in code using obsolete descriptor based APIs.
2022-10-06 10:37:28 +00:00
Pavel Punegov 6b97a7657d [K/N] Publish bundles to maven
Makes build be able to publish bundles to the maven. It uses common
properties and settings as all other Kotlin publications.
Add usage of the Gradle base plugin and correct version and name setting
for archive tasks
2022-10-06 12:18:48 +02:00
Sebastian Sellmair 127c5120dd Only fail parsing KotlinToolingVersion if parsing major or minor fails
^KT-54301 Verification Pending
2022-10-06 07:54:41 +00:00
Igor Chevdar 05016596df [K/N][codegen] Refactored debug info building 2022-10-06 07:12:32 +00:00
Dmitriy Novozhilov 9b63dde1c3 Add error-level OptIn on safeAs, cast and assertedCast functions in addToStdlib
Usage of this function is unsafe because it does not have native compiler
  support. This means that compiler won't report UNCHECKED_CAST,
  CAST_NEVER_SUCCEED or similar diagnostics in case of error cast
  (which can happen immediately or after some refactoring of class hierarchy)
2022-10-06 06:57:07 +00:00
Dmitriy Novozhilov 1cd4f3ad2f [FIR] Get rid of all usages of cast in FIR modules 2022-10-06 06:57:06 +00:00
Dmitriy Novozhilov ee21c966e1 [FIR] Get rid of all usages of safeAs in FIR modules 2022-10-06 06:57:06 +00:00
pyos 8d33de4297 JVM: partially reify typeOf and signatures as soon as possible
E.g. when substituting T -> Array<T>, write the bytecode for the
Array<...> part for typeOf.

This fixes various issues where either Array nesting levels, nullability
information (for typeOf), or entire reification markers were missing,
causing incorrect outputs ranging from missing `?`s to missing `[]`s to
just reified types not really being reified.

^KT-53761 Fixed
2022-10-06 00:58:25 +02:00
Steven Schäfer 2e6817042c IR Validation: Skip INVISIBLE_FAKE members when validating descriptors 2022-10-05 23:48:18 +02:00
Steven Schäfer 1567b27090 Psi2IR: Fix IR types for Java property setters with non-Unit return type 2022-10-05 23:48:18 +02:00
Steven Schäfer 31807a7977 Tests: Print backend errors in test results 2022-10-05 23:48:18 +02:00
Steven Schäfer 860615ece1 JVM IR: Fix unbound symbols in IrPluginContext 2022-10-05 23:48:18 +02:00
Anton Lakotka c358df7033 [Gradle] Include WATCHOS_DEVICE_ARM64 to Commonize unix platform test
^KT-53107
2022-10-05 19:32:05 +00:00
Anton Lakotka e57f9384b9 [Gradle] Use KonanTarget's name instead of calling toString()
^KT-53107
2022-10-05 19:32:04 +00:00
Anton Lakotka eb5a2f65bd [Gradle] Fix tests after adding watchosDeviceArm64 target
^KT-53107
2022-10-05 19:32:04 +00:00
Anton Lakotka fd5c061c0b [Gradle] Use more granular arm64 clang macro's for fat frameworks
After introducing watchOsDeviceArm64 target it conflicted with existing
watchOsArm64 target. Because both having the same Konan Architecture as
Arm64. This is not entirely correct and actual
architectures are different. So it requires more precise macros for
fat framework.

* __ARM64_ARCH_8_32__ for `watchOsArm64` which is based on `arm64_32`
* __ARM64_ARCH_8__ for other arm64 devices including `watchOsDeviceArm64`

^KT-53107
2022-10-05 19:32:03 +00:00
Anton Lakotka 1b3cc0dfaa [Gradle] Register watchosDeviceArm64 in commonizer
^KT-53107
2022-10-05 19:32:03 +00:00
Anton Lakotka 1b7f673e94 [Gradle] Register watchosDeviceArm64 in apple-specific tasks
^KT-53107
2022-10-05 19:32:03 +00:00
Anton Lakotka efa331feed [Gradle] Add arm64 architecture of watchos to AppleSdk object
^KT-53107
2022-10-05 19:32:02 +00:00
Anton Lakotka 640ba1ecfa [Gradle] Add watchosDeviceArm64 to nativeTargetsWithSimulatorTests
^KT-53107
2022-10-05 19:32:02 +00:00
Anton Lakotka 02c9cf74b4 [Gradle] Add watchosDeviceArm64 to KotlinArtifactsExtension
Generate via `generateAbstractKotlinArtifactsExtensionImplementation`

^KT-53107
2022-10-05 19:32:02 +00:00
Anton Lakotka 54d21634aa [Gradle, KPM] Add watchosDeviceArm64 KPM Variant
Generate via `generateKpmNativeVariants`

^KT-53107
2022-10-05 19:32:01 +00:00
Anton Lakotka 3fe5601a70 [Gradle] Add watchosDeviceArm64 target preset
Generate via `generateMppTargetContainerWithPresets`

^KT-53107 Verification Pending
2022-10-05 19:32:01 +00:00
Ilya Kirillov fceb3425c8 [Analysis API FIR] fix invalid usages of CachedValue
it should not cache map as values are stored on soft references
2022-10-05 15:53:54 +00:00
Ilya Kirillov 457069090b [Analysis API FIR] fix LLFirResolveSession creation for KtNotUnderContentRootModule 2022-10-05 15:53:54 +00:00
Ilya Kirillov 4de311f671 [Analysis API FIR] remove unused CachingKtAnalysisSessionProvider.getFirResolveSession(KtSymbol) 2022-10-05 15:53:53 +00:00
Ilya Kirillov b68532a316 [Analysis API FIR] fix memory leaks via KtAnalysisSessionCache keys 2022-10-05 15:53:53 +00:00
Roman Golyshev 3485d65213 [K2] Ignore failing tests for isUsedAsExpression
Those tests do not pass at the moment because of KTIJ-23143
2022-10-05 15:06:52 +00:00
Kristoffer Andersen f765457e51 [K2] isUsedAsExpression analysis 2022-10-05 15:06:52 +00:00
Denis.Zharkov d9701c71b7 Minor. Clean ZipImplementation.kt 2022-10-05 15:03:41 +00:00
Denis.Zharkov 337f461ad8 Fix IndexOutOfBoundsException at FastJarFS
If there are more than 0xffff files in the jar,
we have to use Zip64 format

^KT-52786 Fixed
2022-10-05 15:03:41 +00:00
Kristoffer Andersen fcabc60471 [FIR] Insert fake source for FIR for array access temporaries 2022-10-05 16:22:22 +02:00
Sergey Bogolepov 46feb00ee7 [K/N] KT-48100
Use `"frame-pointer"="all"` on arm64_32 watches.
Motivation: https://github.com/llvm/llvm-project/commit/152df3a
2022-10-05 13:23:49 +00:00
Sebastian Sellmair cda28da09d [kotlin-tooling-core] KotlinToolingVersionOrNull: return null on bad classifier argument
^KT-54301 Verification Pending
2022-10-05 12:19:16 +00:00
Steven Schäfer 760f89efd3 FIR: Fix operator and infix flags for FIR builtins 2022-10-05 12:14:05 +00:00
Ilmir Usmanov 808a73d5b9 FE: Change misleading error message 2022-10-05 11:51:20 +00:00
Marina.Shishkina 53219d60e6 Add changelog for 1.7.20 2022-10-05 13:29:12 +02:00
Margarita Bobova 3424614752 Add changelog for 1.7.10 2022-10-05 13:29:11 +02:00
Nikolay Krasko b5b58f40d6 Workaround instability of Gradle builds caused by the default encoding
The encoding setting from org.gradle.jvmargs is not applied
(https://github.com/gradle/gradle/issues/22292) during
the :kotlin-stdlib-js:compileJs, causing instability in kotlin.js.map
(https://youtrack.jetbrains.com/issue/KT-50589) on machines where
default encoding is not UTF-8.

This reverts commit d7ef5efa6a.

KTI-932
2022-10-05 10:57:46 +00:00
Sergey Bogolepov 289f540530 [Commonizer] workaround for CoreGraphics from Xcode 14 2022-10-05 09:59:10 +00:00
Sergey Bogolepov 94c705d608 [K/N] Remove LocalEscapeAnalysis
It was disabled for a long time because we have
a proper one now.
2022-10-05 08:31:32 +00:00
Sergey Bogolepov 2efcc21d21 [K/N] Extract KonanConfig-dependent methods from Context
Introduce ConfigChecks interface which can be reused between different
classes.
2022-10-05 08:31:32 +00:00
Sergey Bogolepov 60ee30a28d [K/N] Remove some unused code from Context 2022-10-05 08:31:32 +00:00
Sergey Bogolepov 2437e8a06c [K/N] Extract descriptors search from Context into a DescriptorsLookup
Reduces dependency on Context class in Kotlin/Native backend.
2022-10-05 08:31:31 +00:00
Pavel Kunyavskiy 467d2b42fc [K/N] Make AbstractSuspendFunctionsLowering independent of files order
When coroutine class is created, it's made child of SuspendFunction
class. Normally, SuspendFunction class can't be already lowered,
but if we are compiling stdlib it can happen. And if it is
bad fake overrides would be created before this commit.

Unfortunately, as problem can happen only during stdlib compilation,
no specific test can be added.
2022-10-05 06:27:39 +00:00
pyos 5ba76ee757 FIR: convert Java type parameter bounds before reading annotations
This avoids a crash due to circular class references through annotation
arguments.
2022-10-04 19:48:15 +00:00