Alexander Gorshenev
|
67889cb31c
|
Further relocation from 'native' to 'kotlin'
Moved the left behind files and renamed the package.
|
2016-11-08 13:22:24 +03:00 |
|
Konstantin Anisimov
|
4a20e37c9f
|
code generator fixes:
1. IR visitor does not stop children processing on IrClass entry.
2. method call (namely property getter).
|
2016-11-08 11:13:26 +03:00 |
|
Svyatoslav Scherbina
|
55f8257f92
|
build: simplify clang(++) configuration
also introduce 'execClang' block
|
2016-11-08 13:51:25 +07:00 |
|
Konstantin Anisimov
|
4e5e7d37ee
|
Implemented support for loop codegeneration: "while" and "do-while".
for code "while loop":
-------------8<-------------
> cat ../backend.native/tests/codegen/cycles/cycle.kt
fun cycle(cnt: Int): Int {
var sum = 1
while (sum == cnt) {
sum = sum + 1
}
return sum
}
-------------8<-------------
translator generates:
-------------8<-------------
> llvm-dis-mp-3.8 ../backend.native/tests/codegen/cycles/cycle.kt.bc -o -
; ModuleID = '../backend.native/tests/codegen/cycles/cycle.kt.bc'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
...
define i32 @"kfun:cycle"(i32) {
entry:
%cnt = alloca i32
store i32 %0, i32* %cnt
%sum = alloca i32
store i32 1, i32* %sum
br label %label_0
label_0: ; preds = %label_1, %entry
%tmp1 = load i32, i32* %sum
%tmp2 = load i32, i32* %cnt
%tmp0 = icmp eq i32 %tmp1, %tmp2
br i1 %tmp0, label %label_1, label %label_2
label_1: ; preds = %label_0
%tmp6 = load i32, i32* %sum
%tmp5 = add i32 %tmp6, 1
store i32 %tmp5, i32* %sum
br label %label_0
label_2: ; preds = %label_0
%tmp8 = load i32, i32* %sum
ret i32 %tmp8
}
-------------8<-------------
for "do-while" code:
-------------8<-------------
> cat ../backend.native/tests/codegen/cycles/cycle_do.kt
fun cycle_do(cnt: Int): Int {
var sum = 1
do {
sum = sum + 2
} while (sum == cnt)
return sum
}
-------------8<-------------
translator produces:
-------------8<-------------
> llvm-dis-mp-3.8 ../backend.native/tests/codegen/cycles/cycle_do.kt.bc -o -
; ModuleID = '../backend.native/tests/codegen/cycles/cycle_do.kt.bc'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
define i32 @"kfun:cycle_do"(i32) {
entry:
%cnt = alloca i32
store i32 %0, i32* %cnt
%sum = alloca i32
store i32 1, i32* %sum
br label %label_0
label_0: ; preds = %label_1, %entry
%tmp3 = load i32, i32* %sum
%tmp2 = add i32 %tmp3, 2
store i32 %tmp2, i32* %sum
br label %label_1
label_1: ; preds = %label_0
%tmp6 = load i32, i32* %sum
%tmp7 = load i32, i32* %cnt
%tmp5 = icmp eq i32 %tmp6, %tmp7
br i1 %tmp5, label %label_0, label %label_2
label_2: ; preds = %label_1
%tmp8 = load i32, i32* %sum
ret i32 %tmp8
}
-------------8<-------------
|
2016-11-08 06:35:50 +03:00 |
|
Konstantin Anisimov
|
152e738e23
|
Tests for "while" and "do-while" loop generation
|
2016-11-08 06:35:50 +03:00 |
|
Nikolay Igotti
|
bfb6e448c5
|
Remove gradle wrapper in experiments.
|
2016-11-07 19:22:56 +03:00 |
|
alexander-gorshenev
|
bbbec132e5
|
Merge pull request #41 from JetBrains/metadata
Metadata
|
2016-11-07 20:14:54 +04:00 |
|
Alexander Gorshenev
|
9a5454c333
|
Disentangled class metadata and llvm metadata.
It was decided to call class data 'link data'.
And retain the metadata name for LLVM metadata.
|
2016-11-07 18:47:34 +03:00 |
|
Alexander Gorshenev
|
dab43d9862
|
Added some type info to fun metadata
|
2016-11-07 18:16:00 +03:00 |
|
Alexander Gorshenev
|
4afc7be7b7
|
'native' is a java keyword, so javac doesn't allow it as a package name component.
Renamed 'native' to 'konan'.
Moved BinaryMetadata.proto to konan/llvm where it belongs for now.
|
2016-11-07 18:16:00 +03:00 |
|
Alexander Gorshenev
|
56f574684a
|
Code style and nullables fixes
|
2016-11-07 18:16:00 +03:00 |
|
Alexander Gorshenev
|
26e3101014
|
Now we can add metadata nodes to bitcode module.
We just put in the names of functions for now.
|
2016-11-07 18:14:50 +03:00 |
|
Alexander Gorshenev
|
f76a4f6dc9
|
A simple protobuf description for bitcode metadata
|
2016-11-07 18:14:50 +03:00 |
|
Alexander Gorshenev
|
62f8b31cf0
|
Google protobuf has been added to the build
|
2016-11-07 18:14:50 +03:00 |
|
Konstantin Anisimov
|
d4c3d6dabd
|
plus'n'minus_eq operation: support for integer comparison operations
for code (plus_eq):
--------------8<------------------
> cat ../backend.native/tests/codegen/function/plus_eq.kt
fun plus_eq(a: Int): Int {
var b = 11
b += a
return b
}
--------------8<------------------
generator produces:
--------------8<------------------
> llvm-dis-mp-3.8 ../backend.native/tests/codegen/function/plus_eq.kt.bc -o -
; ModuleID = '../backend.native/tests/codegen/function/plus_eq.kt.bc'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
....
define i32 @"kfun:plus_eq"(i32) {
entry:
%a = alloca i32
store i32 %0, i32* %a
%b = alloca i32
store i32 11, i32* %b
%tmp1 = load i32, i32* %b
%tmp2 = load i32, i32* %a
%tmp0 = add i32 %tmp1, %tmp2
store i32 %tmp0, i32* %b
%tmp3 = load i32, i32* %b
ret i32 %tmp3
}
--------------8<------------------
and for (minus_eq):
--------------8<------------------
> cat ../backend.native/tests/codegen/function/minus_eq.kt
fun minus_eq(a: Int): Int {
var b = 11
b -= a
return b
}
--------------8<------------------
generator produces:
--------------8<------------------
> llvm-dis-mp-3.8 ../backend.native/tests/codegen/function/minus_eq.kt.bc -o -
; ModuleID = '../backend.native/tests/codegen/function/minus_eq.kt.bc'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
...
define i32 @"kfun:minus_eq"(i32) {
entry:
%a = alloca i32
store i32 %0, i32* %a
%b = alloca i32
store i32 11, i32* %b
%tmp1 = load i32, i32* %b
%tmp2 = load i32, i32* %a
%tmp0 = sub i32 %tmp1, %tmp2
store i32 %tmp0, i32* %b
%tmp3 = load i32, i32* %b
ret i32 %tmp3
}
--------------8<------------------
|
2016-11-07 18:00:30 +03:00 |
|
Konstantin Anisimov
|
ea149fab4e
|
Tests for "PLUSEQ" and "MINUSEQ"
|
2016-11-07 18:00:30 +03:00 |
|
Nikolay Igotti
|
a022b7d1ab
|
Char constants.
|
2016-11-07 17:42:29 +03:00 |
|
Konstantin Anisimov
|
3c68ee4ce5
|
testsuite updated to reflect recent changes in codegen: branch support
|
2016-11-07 17:34:01 +03:00 |
|
Vasily Levchenko
|
76ee79adc0
|
branching: branch suppport introduced
--------------8<----------------
> cat if_else.kt
fun if_else(b: Boolean): Int {
if (b) return 42
else return 24
}
--------------8<----------------
we've got following bitcode:
--------------8<----------------
; ModuleID = '../backend.native/tests/codegen/branching/if_else.kt.bc'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
...
define i32 @"kfun:if_else"(i1) {
entry:
%b = alloca i1
store i1 %0, i1* %b
%tmp0 = load i1, i1* %b
br i1 %tmp0, label %label_0, label %label_1
label_0: ; preds = %entry
ret i32 42
label_1: ; preds = %entry
ret i32 24
}
...
--------------8<----------------
|
2016-11-07 17:34:01 +03:00 |
|
Vasily Levchenko
|
147de5d3ad
|
added .usr/bin path to tools chain to take right variants of binutils from our system archieve
|
2016-11-07 17:25:08 +03:00 |
|
Nikolay Igotti
|
f06aeef9ce
|
Some work for string concatenation. (#40)
|
2016-11-07 15:58:11 +03:00 |
|
Svyatoslav Scherbina
|
451ac00087
|
backend/tests: enable hello0
|
2016-11-07 17:42:47 +07:00 |
|
Svyatoslav Scherbina
|
674713f429
|
backend: instantiate string literals statically
also improve other code for static instantiation
|
2016-11-07 17:42:47 +07:00 |
|
vvlevchenko
|
fddaea5624
|
Merge pull request #34 from JetBrains/ir-processing-refactoring
Ir processing refactoring
|
2016-11-03 20:42:32 +03:00 |
|
Vasily Levchenko
|
8880a8b7a9
|
disable object initialization test
|
2016-11-03 18:34:35 +03:00 |
|
Konstantin Anisimov
|
fb1652a1d5
|
refactoring: refactoring: reordering, splitting.
(cherry picked from commit 89fc5d6416a6e7075901ac19dea44475f7184fd3)
|
2016-11-03 18:34:35 +03:00 |
|
Nikolay Igotti
|
922cb1f35d
|
Fix problems with kotlin.Number
|
2016-11-03 18:28:02 +03:00 |
|
Nikolay Igotti
|
96dfcba997
|
Generate interface RTTI properly.
|
2016-11-03 18:13:55 +03:00 |
|
vvlevchenko
|
152b8752d0
|
Merge pull request #32 from JetBrains/ir-processing-enchancements
ir-enchancement:support operations with variables and block processing
|
2016-11-03 17:15:52 +03:00 |
|
Konstantin Anisimov
|
4078e4004c
|
tests for local variables
|
2016-11-03 16:19:03 +03:00 |
|
Vasily Levchenko
|
8de943bb8a
|
ir-enchancement:support operations with variables and block processing
|
2016-11-03 16:19:03 +03:00 |
|
Nikolay Igotti
|
a2e4f0f467
|
Move compiler to new version, add primitive types. (#33)
|
2016-11-03 15:31:33 +03:00 |
|
Vasily Levchenko
|
c6a5ec26d9
|
stash conflict occsionaly commited removed
|
2016-11-03 06:29:41 +03:00 |
|
Vasily Levchenko
|
09fb11fbc9
|
linux run test fix (except RTTI linking problems)
|
2016-11-03 06:19:26 +03:00 |
|
Nikolay Igotti
|
1f90f32397
|
Fix backend.native:run
|
2016-11-03 00:22:04 +03:00 |
|
Svyatoslav Scherbina
|
58e8ed1850
|
backend/tests/build: fix compiler native library path
|
2016-11-02 17:02:14 +07:00 |
|
Svyatoslav Scherbina
|
e7558f9ddc
|
build: add target native SDK as downloadable dependency
also improve Gradle native toolchains configuration
|
2016-11-02 17:02:14 +07:00 |
|
Svyatoslav Scherbina
|
db1853f627
|
runtime: remove unused test
to simplify build configuration
|
2016-11-02 17:02:14 +07:00 |
|
Nikolay Igotti
|
5966f69928
|
Add Base64 encoding for printable hashes (SHA1 hash is 30 bytes, City is 14). (#30)
|
2016-11-02 12:44:36 +03:00 |
|
Vasily Levchenko
|
b3fb82da07
|
unwanted print
|
2016-11-01 21:58:02 +03:00 |
|
Vasily Levchenko
|
ac761e0cbf
|
unit tests and run tests are splitted
run tests can use golden value and test data to process and compare results
|
2016-11-01 21:49:20 +03:00 |
|
Nikolay Igotti
|
283303210f
|
Rename kotlin_native -> kotlin.
|
2016-11-01 16:13:46 +03:00 |
|
Nikolay Igotti
|
7eeb2d3046
|
Various fixes for HelloWorld. (#27)
|
2016-11-01 15:33:41 +03:00 |
|
Nikolay Igotti
|
b142d39dbc
|
Merge pull request #28 from JetBrains/fix_void
Fix void calls.
|
2016-11-01 13:12:47 +03:00 |
|
Nikolay Igotti
|
7cf38d9501
|
Fix void calls.
|
2016-11-01 13:11:39 +03:00 |
|
Vasily Levchenko
|
08bfdb652c
|
processing Call IR expressions and void functions (crash expected)
|
2016-11-01 12:48:46 +03:00 |
|
Vasily Levchenko
|
ecdac4190c
|
added processing of the BLOCK_BODY, for Unit function IR doesn't contein RETURN:
FUN public fun bar(i: kotlin.Int): kotlin.Unit
BLOCK_BODY
for code:
fun bar(i:Int):Unit {}
|
2016-10-31 21:31:32 +03:00 |
|
Vasily Levchenko
|
df9bf60c30
|
g/c: unused vars
|
2016-10-31 20:56:58 +03:00 |
|
Vasily Levchenko
|
ae3fbfcc67
|
g/c: line balance
|
2016-10-31 20:56:58 +03:00 |
|
Vasily Levchenko
|
90883b6ced
|
g/c: -linq
|
2016-10-31 20:56:58 +03:00 |
|