Commit Graph

1831 Commits

Author SHA1 Message Date
Konstantin Anisimov f352c145fd Turn on disabled inlining tests 2017-03-15 20:11:27 +07:00
Konstantin Anisimov 98322d6f55 All arguments evaluated before inlining procedure
Type of "substituteMap" changed to "MutableMap"
Code improved according with Slava's comments
2017-03-15 20:11:27 +07:00
Konstantin Anisimov 22b74c0a3a New tests added 2017-03-15 20:11:27 +07:00
Konstantin Anisimov 39f002db81 Combine parameter evaluation with parameter transformer 2017-03-15 20:11:27 +07:00
Konstantin Anisimov 3ebcf92f8b Intermediate results commit 2017-03-15 20:11:27 +07:00
Konstantin Anisimov 8d62ed20ea Workaround for reified args in "genInstanceOf". Will be replaced with "throw exception" 2017-03-15 20:11:27 +07:00
Konstantin Anisimov 023e0c1c70 Remove dead code from test 2017-03-15 20:11:27 +07:00
Vasily Levchenko 5215a9b60b STDLIB: added emptyArray() 2017-03-15 15:33:56 +03:00
Svyatoslav Scherbina c9b04bc0bb Fix methods inherited from Any in interop value types 2017-03-15 18:20:06 +07:00
Svyatoslav Scherbina d1859dd280 Improve function types support in interop
* Support `typedef` to function type without pointer;
* Support 64-bit integers in function types;
* Generate opaque function type on JVM if not supported.

Fix other minor bugs.
2017-03-15 18:20:06 +07:00
Nikolay Igotti 397928b066 Release notes. (#316) 2017-03-14 18:56:41 +03:00
SvyatoslavScherbina 2882e6fab7 Improve interop enums (#341)
* Update build to Kotlin 1.1.0

* Add heuristics and options for selecting C enum interop binding style

Also do some refactoring.

* Add ':Interop:Indexer:updatePrebuilt' Gradle task

* Update Interop/Indexer/prebuilt
2017-03-14 18:52:37 +03:00
Vasily Levchenko ec68a3a24e IR: defaults: calculate right this dispatch receiver parameter.
previously in case:
```
fun box(): String {
    val a: A = B(1)
    a.copy(1)
    a.component1()
    return "OK"
}

interface A {
    fun copy(x: Int): A
    fun component1(): Any
}

data class B(val x: Int) : A
```

in stab `B::copy$default` `B::copy` called with `A::this` that behaviour isn't correct, should be `B::this` used.
2017-03-14 18:36:18 +03:00
Ilya Matveev 10eef395f4 stdlib: Add empty kotlin.experimental package
This patch adds empty kotlin.experimental package to avoid unresolved
reference errors in bitwiseOp tests:

external_codegen_box_binaryOp/bitwiseOp.kt
external_codegen_box_binaryOp/bitwiseOpAny.kt
external_codegen_box_binaryOp/bitwiseOpNullable.kt

Byte/Short bitwise operations are supported in Kotlin Native by default.
2017-03-14 16:24:20 +03:00
Alexander Udalov b08ccf07cb Remove usages of Kotlin compiler built-ins (loaded from kotlin-compiler.jar's resources) (#323)
* Do not add dependency on compiler built-ins, add missing declarations

* Drop most usages of KonanPlatform.builtIns

Instead, lookup symbols through the module that is being compiled. This
should be more correct because KonanPlatform.builtIns represents
built-ins loaded from kotlin-compiler.jar's resources

* Minor, make Context.moduleDescriptor lateinit and not null

* Do not ever load KonanBuiltIns from Kotlin compiler anymore

KonanBuiltIns.builtInsModule is now always the module that is being
compiled at the moment. An instance of KonanBuiltIns is thus nothing
more than a helper that loads classes with some predefined names from
the module that is being compiled

* Temporarily disable a part of IR validation
2017-03-14 15:48:42 +03:00
Igor Chevdar ccbf4bb963 Supported KProperty2 and KMutableProperty2 (#340)
Consider this code:
object Delegate {
    operator fun getValue(t: Any?, p: KProperty<*>): String {
        return ""
    }
}

class A {
    val String.ext by Delegate
}

then the type of <p> is KProperty2 (it has 2 receivers).
2017-03-14 08:43:30 -04:00
Nikolay Igotti 29726e601f Fix interop tool on Linux 2017-03-14 13:04:33 +03:00
Nikolay Igotti 7615931b84 Add missing exceptions, make exception classes open (#338) 2017-03-14 12:01:37 +03:00
Svyatoslav Scherbina c9e2b5ac69 backend: fix handling unreachable return from inlined function 2017-03-14 13:32:46 +07:00
Svyatoslav Scherbina 37b7940544 Interop: generate fewer adapters when targeting Kotlin Native
Also do some refactoring.
2017-03-14 13:01:38 +07:00
Vasily Levchenko a78f38d26c compiler: 1.1-20170310.145051-441 2017-03-13 19:14:40 +03:00
Ilya Matveev d3945bff3b tests: Add fail() function to TestUtils 2017-03-13 19:03:57 +03:00
Ilya Matveev 8e91da7aad build/tests: Import box() function package in the launcher 2017-03-13 19:03:57 +03:00
Ilya Matveev 89b2cc05bd build/tests: Create separate output dir for each external test 2017-03-13 19:03:57 +03:00
Vasily Levchenko 366b0834ae compiler: 1.1-20170309.105410-440 2017-03-13 19:01:09 +03:00
Igor Chevdar 1cd229d8e5 Default enum class should not have primary constructor. (#335)
* Default enum class should not have primary constructor.

* Made simple delegating constructor non-primary + some refactoring.

* Make singleton object constructor primary.
2017-03-13 11:46:11 -04:00
SvyatoslavScherbina b803e95c0b backend: fix kt6590_identityEquals.kt (#333)
Customize `===` for value types to achive the same behavior as with JVM BE
2017-03-13 16:45:33 +03:00
Ilya Matveev 20ffd6d90b tests: Add test for assertion fail 2017-03-13 16:25:48 +03:00
Ilya Matveev 97b5bb527d backend: Generate assert call depending on the compiler key 2017-03-13 16:25:48 +03:00
Ilya Matveev 30be84cd55 stdlib: Add assert() functions. 2017-03-13 16:25:48 +03:00
Ilya Matveev a181b0301e Update README.md and HACKING.md 2017-03-13 15:31:46 +03:00
Ilya Matveev bc074e6d39 tests: Update external tests (1.1.2-dev-393) 2017-03-13 15:31:46 +03:00
Ilya Matveev ac56fccb15 tests: Download test data as a teamcity artifact 2017-03-13 15:31:46 +03:00
Ilya Matveev 232d2ff14c tests: Compile only *.kt files 2017-03-13 15:31:46 +03:00
Svyatoslav Scherbina 7751e66daa backend: validate IR module after every phase if -verify_ir is enabled 2017-03-13 17:07:55 +07:00
Svyatoslav Scherbina 95935921ba backend: implement simple IR validator 2017-03-13 17:07:55 +07:00
Svyatoslav Scherbina d4fc79da43 backend: fix type operator result type in autoboxing 2017-03-13 17:07:55 +07:00
Svyatoslav Scherbina 11f2ea7e38 backend: fix IrReturn type in enum class lowering 2017-03-13 17:07:55 +07:00
Svyatoslav Scherbina d49023e172 backend: fix null type in default arguments lowering 2017-03-13 17:07:55 +07:00
Svyatoslav Scherbina a41f575f52 backend/tests: add interop_opengl_teapot 2017-03-13 11:00:33 +07:00
Svyatoslav Scherbina 304a9ebd8e build/tests: support declaring tests to be manually executed 2017-03-13 11:00:33 +07:00
Svyatoslav Scherbina 725e367614 build/tests: implement passing interop linker args to compiler 2017-03-13 11:00:33 +07:00
Svyatoslav Scherbina 7ad36ac035 backend: implement '-linkerArg' to pass arguments to the linker 2017-03-13 11:00:33 +07:00
Svyatoslav Scherbina 46fde200be Interop/Runtime: add allocArrayOf(vararg Float) 2017-03-13 11:00:33 +07:00
Svyatoslav Scherbina 498c33a4e0 Interop/StubGenerator: fix some bugs related to typedef 2017-03-13 11:00:33 +07:00
Svyatoslav Scherbina 54b8b5f3a3 Interop/StubGenerator: improve naming 2017-03-13 11:00:33 +07:00
Igor Chevdar ed2191b4a3 Initializers lowering fix: clone init blocks. (#321)
* Initializers lowering fix: clone init blocks.

In order to let following phases to modify IR we need to clone init blocks
for each constructor before inserting it.

* Used DeepCopyIRTreeWithDescriptors.

* Shared variables lowering must be performed before local functions lowering.

Local functions lowering makes all variables non-shared, thus they must be
transformed into Ref<> before this.

* Moved all initializers into a method.

In order not to deal with copying of IR at all it is easier to create a
method 'initialize' which will be called from each constructor.

* Used right parameters for call.

* If class has primary constructor then move initializers to it.

* review fixes
2017-03-10 19:02:02 +05:00
Alexander Gorshenev 1f9d41b291 Added a TODO on -Dkonan.home use in pre-dist world. 2017-03-10 17:36:58 +04:00
Alexander Gorshenev aea99897c4 Added -isystem to Mac interop stub build, so that it doesn't lose the clang owned headers. 2017-03-10 17:36:58 +04:00
Alexander Gorshenev a995fbcb59 This is a simple command line tool for interop.
See INTEROP.md on how to use it.
2017-03-10 17:36:58 +04:00