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
2016-10-17 13:59:33 +03:00
2016-10-27 13:52:00 +03:00
2016-10-07 14:14:00 +03:00
2016-10-27 13:52:00 +03:00
2016-10-27 13:52:00 +03:00

Kotlin-native backend

Build

Download dependencies:

gradle :dependencies:update

To run native translator just use:

gradle :backend.native:run

And it will run simple example (currently prints out IR of test file). For more tests, use:

gradle :backend.native:tests:run
S
Description
The Kotlin Programming Language.
Readme 2.1 GiB
Languages
Kotlin 79.9%
Java 10.4%
Swift 4.3%
C 2.8%
C++ 2.1%
Other 0.3%