translator with kotlin 1.0.5

This commit is contained in:
Vasily Levchenko
2016-09-16 20:44:33 +03:00
parent 3d6013cbf0
commit e50e6ed96d
4 changed files with 8 additions and 1 deletions
@@ -21,6 +21,8 @@ import org.kotlinnative.translator.TranslationState
import org.kotlinnative.translator.VariableManager import org.kotlinnative.translator.VariableManager
import org.kotlinnative.translator.llvm.* import org.kotlinnative.translator.llvm.*
import org.kotlinnative.translator.llvm.types.* import org.kotlinnative.translator.llvm.types.*
import java.lang.RuntimeException
import java.lang.UnsupportedOperationException
import java.rmi.UnexpectedException import java.rmi.UnexpectedException
import kotlin.comparisons.compareBy import kotlin.comparisons.compareBy
@@ -1095,7 +1097,7 @@ abstract class BlockCodegen(val state: TranslationState,
is LLVMVariable -> LLVMVariable(retVar.label, LLVMNullType(returnType!!.type), retVar.kotlinName, retVar.scope, returnType!!.pointer - 1) is LLVMVariable -> LLVMVariable(retVar.label, LLVMNullType(returnType!!.type), retVar.kotlinName, retVar.scope, returnType!!.pointer - 1)
else -> throw UnexpectedException("Unknown inheritor of LLVMSingleValue") else -> throw UnexpectedException("Unknown inheritor of LLVMSingleValue")
} }
generateReferenceReturn(retVar) generateReferenceReturn(retVar!!)
} }
is LLVMVoidType -> codeBuilder.addAnyReturn(LLVMVoidType()) is LLVMVoidType -> codeBuilder.addAnyReturn(LLVMVoidType())
else -> { else -> {
@@ -1,3 +1,5 @@
package org.kotlinnative.translator.exceptions package org.kotlinnative.translator.exceptions
import java.lang.Exception
class TranslationException(message: String) : Exception(message) class TranslationException(message: String) : Exception(message)
@@ -1,3 +1,5 @@
package org.kotlinnative.translator.exceptions package org.kotlinnative.translator.exceptions
import java.lang.Exception
class UnimplementedException() : Exception() class UnimplementedException() : Exception()
@@ -2,6 +2,7 @@ package org.kotlinnative.translator.llvm.types
import org.kotlinnative.translator.llvm.LLVMExpression import org.kotlinnative.translator.llvm.LLVMExpression
import org.kotlinnative.translator.llvm.LLVMSingleValue import org.kotlinnative.translator.llvm.LLVMSingleValue
import java.lang.IllegalArgumentException
class LLVMBooleanType() : LLVMType() { class LLVMBooleanType() : LLVMType() {