translator: fix object calls
This commit is contained in:
@@ -23,7 +23,7 @@ class ObjectCodegen(override val state: TranslationState, override val variableM
|
||||
|
||||
fun generate() {
|
||||
generate(objectDeclaration.declarations)
|
||||
val classInstance = LLVMVariable("object.instance.$structName", type, objectDeclaration.name, LLVMVariableScope())
|
||||
val classInstance = LLVMVariable("object.instance.$structName", type, objectDeclaration.name, LLVMVariableScope(), pointer=1)
|
||||
codeBuilder.addGlobalIntialize(classInstance, type)
|
||||
variableManager.addGlobalVariable(structName, classInstance)
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
singletone_test(5) == 40
|
||||
singleton_test(5) == 40
|
||||
|
||||
@@ -4,7 +4,6 @@ object Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
fun signleton_test(i: Int): Int {
|
||||
fun singleton_test(i: Int): Int {
|
||||
return Singleton.create(i)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user