translator: fix default value for void

This commit is contained in:
Alexey Stepanov
2016-07-14 11:37:35 +03:00
parent b3e1fbdbb4
commit 5419699cfc
2 changed files with 1 additions and 6 deletions
@@ -12,16 +12,11 @@ import org.kotlinnative.translator.llvm.LLVMVariable
class PropertyCodegen(val state: TranslationState, val property: KtProperty, val codeBuilder: LLVMBuilder) {
private val variableManager = state.variableManager
companion object PropertyState {
}
fun generate() {
val varInfo = state.bindingContext.get(BindingContext.VARIABLE, property)?.compileTimeInitializer ?: return
val kotlinType = varInfo.type
val value = varInfo.value
//[TODO] compile time initizializer
if (kotlinType.nameIfStandardType != null) {
val variableType = LLVMMapStandardType(property.name ?: return, kotlinType).type
val variable = LLVMVariable(property.name.toString(), variableType, property.name.toString(), LLVMGlobalScope(), pointer = true)
@@ -4,7 +4,7 @@ class LLVMVoidType() : LLVMType() {
override val align = 0
override val size: Byte = 0
override val defaultValue = throw UnsupportedOperationException()
override val defaultValue = ""
override fun toString(): String = "void"
}