Handle String constructor call in code generator
This commit is contained in:
committed by
SvyatoslavScherbina
parent
bb1c52c23b
commit
47dfe122fc
+5
@@ -1659,6 +1659,11 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid
|
|||||||
assert(args.size >= 1 && args[0].type == int32Type)
|
assert(args.size >= 1 && args[0].type == int32Type)
|
||||||
codegen.allocArray(codegen.typeInfoValue(constructedClass), args[0],
|
codegen.allocArray(codegen.typeInfoValue(constructedClass), args[0],
|
||||||
resultLifetime(callee))
|
resultLifetime(callee))
|
||||||
|
} else if (constructedClass == context.builtIns.string) {
|
||||||
|
// TODO: consider returning the empty string literal instead.
|
||||||
|
assert(args.size == 0)
|
||||||
|
codegen.allocArray(codegen.typeInfoValue(constructedClass), count = kImmZero,
|
||||||
|
lifetime = resultLifetime(callee))
|
||||||
} else {
|
} else {
|
||||||
codegen.allocInstance(codegen.typeInfoValue(constructedClass), resultLifetime(callee))
|
codegen.allocInstance(codegen.typeInfoValue(constructedClass), resultLifetime(callee))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user