translator: fix issue with string fucntion argument
This commit is contained in:
@@ -23,6 +23,7 @@ fun LLVMInstanceOfStandardType(name: String, type: KotlinType, scope: LLVMScope
|
||||
type.toString() == "Long" -> LLVMVariable(name, LLVMLongType(), name, scope)
|
||||
type.toString() == "Float" -> LLVMVariable(name, LLVMFloatType(), name, scope)
|
||||
type.toString() == "Double" -> LLVMVariable(name, LLVMDoubleType(), name, scope)
|
||||
type.toString() == "String" -> LLVMVariable(name, LLVMStringType(0), name, scope)
|
||||
type.nameIfStandardType.toString() == "Nothing" -> LLVMVariable(name, LLVMNullType(), name, scope)
|
||||
type.isUnit() -> LLVMVariable("", LLVMVoidType(), name, scope)
|
||||
type.isMarkedNullable -> LLVMVariable(name, LLVMReferenceType(type.toString().dropLast(1)), name, scope, pointer = 1)
|
||||
|
||||
+6
@@ -8,6 +8,12 @@ class LLVMStringType(override val length: Int) : LLVMArray, LLVMType() {
|
||||
|
||||
override fun mangle() = "String"
|
||||
|
||||
override fun equals(other: Any?): Boolean =
|
||||
when (other) {
|
||||
is LLVMStringType -> this.length == other.length
|
||||
else -> false
|
||||
}
|
||||
|
||||
override fun basicType() = LLVMCharType()
|
||||
override val typename = "i8*"
|
||||
override fun fullType() = "[${length + 1} x i8]"
|
||||
Reference in New Issue
Block a user