Commit Graph

694 Commits

Author SHA1 Message Date
Ilya Goncharov 637d45c539 [IR] Disable rename of inline symbols
Merge-request: KT-MR-5801
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
2022-02-22 15:59:02 +00:00
Sergey Bogolepov 50cc4f301d [K/N] Manually add the rest of hosts to the dependency in KT-51302 2022-02-17 11:12:58 +00:00
Sergey Bogolepov a22dcc0f14 [K/N] Test case for KT-51302
There is no infrastructure for testing klib ABI compatibility yet.
As a workaround, we store klib directly in repo.
2022-02-17 11:12:57 +00:00
Svyatoslav Scherbina 1fdb86d517 Native: fix loading libllvmstubs.dylib on macOS 12.3 Beta
Link libllvmstubs.dylib to `$sysroot/usr/lib/libc++.1.dylib`
instead of `$llvm/lib/libc++.1.dylib`.
The latter has `@rpath/libc++.1.dylib` as install name, so
the dynamic linker was unable to find it when loading
libllvmstubs.dylib on macOS 12.3.

^KT-51359 Fixed
2022-02-17 11:07:26 +00:00
Dmitriy Dolovov 56510fbc6c [Native][tests] Dump the list of all available tests during compilation
^KT-50316
2022-02-17 12:45:37 +03:00
Sergey Bogolepov 52c8b6166c [K/N] Fix filecheck_function_attributes_at_callsite test 2022-02-14 13:38:51 +00:00
Sergey Bogolepov fbbe5cbd03 [K/N] Disable filecheck tests in some cases 2022-02-14 13:38:50 +00:00
Sergey Bogolepov b4cbe703cd [K/N] Test for KT-50970 2022-02-14 13:38:50 +00:00
Sergey Bogolepov ad793ac624 [K/N] Support cross targets in FileCheckTest
Also mark property's getter with Input and Optional annotations instead of
property itself.
2022-02-14 13:38:49 +00:00
Dmitriy Dolovov f62dcf65fc [Native][tests] Fix generation of *.def file in accidentally disappeared dir 2022-02-14 13:41:00 +03:00
Dmitriy Dolovov 334dffd3e4 [Native][tests] Remove external tests from old test infra 2022-02-14 13:41:00 +03:00
Pavel Kunyavskiy b575d98272 [K/N] Eliminate frame creation in some cases 2022-02-11 13:52:07 +00:00
Svyatoslav Scherbina d8b1992fde Native: fix cinterop for Swift-produced Objective-C categories
For some reason, libclang's indexer doesn't index categories with
__attribute__((external_source_symbol(language="Swift",...))),
so we have to additionally enumerate them explicitly.

^KT-49455 Fixed
2022-02-11 12:45:39 +00:00
Svyatoslav Scherbina ad72545647 ObjCExport: deprecate exporting data class componentN methods to Obj-C
The Objective-C methods for Kotlin data class componentN methods
shouldn't have been generated in the first place -- the corresponding
Kotlin methods are required to make the destructuring work in Kotlin,
and don't help in Objective-C or Swift.

Calling them manually from Objective-C or Swift doesn't make much sense.
So now we deprecate this, in order to remove these methods from
Objective-C header completely later.

^KT-42641
^KT-49516 Fixed
2022-02-11 06:55:47 +00:00
Svyatoslav Scherbina 62c1bd0044 Native: fix using nested expect enum entry in a default argument
^KT-51156 Fixed
2022-02-09 14:41:11 +00:00
Svyatoslav Scherbina 76672a4abf Native: terminate if cinterop ObjC reference conversion throws exception
To avoid forwarding Obj-C exceptions to Kotlin or vice versa.
Otherwise this might lead to a crash or other undesirable behaviour.

^KT-50648 Fixed
2022-02-09 07:47:42 +00:00
Svyatoslav Scherbina cd62b5b3b3 ObjCExport: optimize receiving autoreleased references from Obj-C/Swift
when the callee supports this.
2022-02-08 15:17:06 +00:00
Svyatoslav Scherbina 085e2448cd ObjCExport: don't use autorelease when sending arguments to Swift/Obj-C 2022-02-08 15:17:04 +00:00
Svyatoslav Scherbina 9326978327 ObjCExport: fix noAutorelease tests for the new MM 2022-02-08 15:17:04 +00:00
Svyatoslav Scherbina d161108be3 ObjCExport: fix noAutorelease/testReceiveBlockFromSwiftAndCall
The test expects to track block result lifetime in Swift, so we should
add it to the tracker.

Also fix the same problem for testReceiveBlockFromKotlinAndCall
(which didn't fail because we added the block itself to the tracker).
2022-02-08 15:17:04 +00:00
Ilya Matveev 8668797afd [K/N][tests] Do not run backed.native tests with aggressive GC 2022-02-03 07:30:33 +00:00
Igor Chevdar c0715cfb0c [K/N][IR][caches] Fixed problems with inline classes
Fixes https://youtrack.jetbrains.com/issue/KT-50978
2022-02-02 22:46:16 +05:00
Igor Chevdar 554e94a322 [K/N][IR] Never consider a enum a final class
Unfortunately, neither descriptors nor Lazy IR have enough information
to correctly deduce a enum's modality as psi2ir does, so to avoid the RTTI generator
generating different vtables in different setups (whether a klib is cached or not),
conservatively consider all enums non-final.
2022-02-02 22:46:15 +05:00
Igor Chevdar 97a28df43d [K/N][IR] Handle some corner cases for enums when building caches
Helps workaround https://youtrack.jetbrains.com/issue/KT-50977
2022-02-02 22:43:53 +05:00
Igor Chevdar 9e7d8808bd [K/N][IR] Used new declaration parents checker 2022-01-28 18:21:13 +00:00
Svyatoslav Scherbina 4cd60090e0 ObjCExport: fix replacing Kotlin class methods by Swift extensions
^KT-49937 Fixed
2022-01-28 11:15:39 +00:00
Igor Chevdar 1aea2d0437 [K/N][IR] Respect -Xlazy-ir-for-caches on caches building 2022-01-28 13:14:37 +05:00
Igor Chevdar 0cc48440e1 [K/N][IR] Properly handle enums when building caches
Helps to fix https://youtrack.jetbrains.com/issue/KT-50977 but not entirely
2022-01-28 12:35:50 +05:00
Ilya Matveev 1e78036a1b [K/N] Enable CMS GC by default for the new MM
Issue #KT-50713 Fixed
2022-01-28 12:24:57 +07:00
Georgy Bronnikov 6a3a375372 IR: pass DescriptorByIdSignatureFinder as parameter to DeclarationStubGeneratorimpl
This breaks dependency between serialization.common and psi2ir modules.
2022-01-27 01:02:23 +03:00
Georgy Bronnikov 3f91674090 IR: inline and remove ...FromLinker methods from SymbolTable 2022-01-27 01:02:22 +03:00
Georgy Bronnikov 3a72c44184 Repair Native compilation 2022-01-27 01:02:22 +03:00
Georgy Bronnikov 3cc883cf7b IR: use DescriptorBySignatureFinder in DeclarationStubGenerator
Duplicating code that was used for the same purpose in
DeclarationStubGenerator is removed.
2022-01-27 01:02:14 +03:00
Dmitriy Dolovov 15e6101608 [IR, Native] Support partial linkage in backend
^KT-50775
2022-01-26 13:36:23 +03:00
Dmitriy Dolovov 4726b14c4b [IR, Native] Refactoring: Introduce KonanUnlinkedDeclarationsSupport
^KT-50775
2022-01-26 13:36:23 +03:00
Dmitriy Dolovov 319125607e [IR, JS] Refactoring: Introduce JsUnlinkedDeclarationsSupport
^KT-50775
2022-01-26 13:36:23 +03:00
Dmitriy Dolovov cc37934d6f [IR, Native] Add compiler flag for partial linkage mode
^KT-50775
2022-01-26 13:36:23 +03:00
Pavel Kunyavskiy 803014ef24 [K/N] Test for freezing disabling 2022-01-25 13:43:48 +00:00
Sergey Bogolepov 322bffd75a [K/N] Add FileCheck test for constants merging 2022-01-25 09:11:01 +00:00
Sergey Bogolepov a6455a906b [K/N] Fix KT-50843
Marking constants with unnamed_addr allows LLVM to merge them.
2022-01-25 09:10:59 +00:00
Pavel Kunyavskiy 80b50f5452 [K/N] Disable freezing by default, if memory model is experimental 2022-01-24 13:38:30 +00:00
Pavel Kunyavskiy 3798920183 [K/N] Any.isFrozen is now always false when freezing is disabled 2022-01-24 13:38:30 +00:00
Dmitriy Novozhilov dd953908df [FE 1.0] Add compiler flag for rendering internal diagnostic names in error messages 2022-01-23 11:14:56 +03:00
Svyatoslav Scherbina a65b278f71 Native: generate debug locations for catch parameters
^KT-50558 Fixed
2022-01-21 16:08:13 +00:00
Alexander Udalov 6445a29893 IR: remove type parameter in visitConst
Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:35 +01:00
Alexander Udalov 81106526b1 IR: remove IrConstantObject.putArgument, IrConstantArray.putElement
Change `valueArguments` and `elements` types to be mutable lists. This
will simplify IR tree generator.
2022-01-19 17:50:35 +01:00
Pavel Kunyavskiy 2f853175c7 [K/N] Get rid of using base class default values for annotations
They can be not available in incremental compilation case

^KT-50211
2022-01-19 13:17:17 +00:00
Pavel Punegov 3db341213b [K/N] Synchronize LLVM target initialization
Race conditions should be avoided during initialization.
See llvm/lib/Support/TargetRegistry.cpp in LLVM repo
2022-01-19 11:18:43 +00:00
Svyatoslav Scherbina ec3a2c9671 Native: remove cleanup landingpad if it is unused
Useful for ObjCExport, because most of its bridges don't use it.
2022-01-18 08:15:15 +00:00
Svyatoslav Scherbina 47a0bdc1bc Native: remove forwardingForeignExceptionsTerminatedWith
It is no longer used, and was generally misdesigned.
2022-01-18 08:15:15 +00:00