backend: do not declare function if it has already been declared
This commit is contained in:
committed by
Nikolay Igotti
parent
fbb79418c4
commit
d2d90e8066
+1
-1
@@ -78,7 +78,7 @@ internal class CodeGenerator(override val context:Context) : ContextUtils {
|
||||
private fun prolog(declaration: IrFunction): LLVMOpaqueValue? {
|
||||
index = 0
|
||||
currentFunction = declaration.descriptor
|
||||
val fn = LLVMAddFunction(context.llvmModule, declaration.descriptor.symbolName, getLlvmFunctionType(declaration.descriptor))
|
||||
val fn = declaration.descriptor.llvmFunction.getLlvmValue()
|
||||
val block = LLVMAppendBasicBlock(fn, "entry")
|
||||
LLVMPositionBuilderAtEnd(context.llvmBuilder, block)
|
||||
function2variables.put(declaration.descriptor, mutableMapOf())
|
||||
|
||||
Reference in New Issue
Block a user