translator: fix object calls

This commit is contained in:
Alexey Stepanov
2016-07-20 12:38:26 +03:00
parent 5b53edfc28
commit b345eeff4f
3 changed files with 3 additions and 4 deletions
@@ -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)
}