Various small fixes. (#208)
This commit is contained in:
-2
@@ -17,8 +17,6 @@ import java.lang.System.out
|
||||
|
||||
internal final class Context(val config: KonanConfig) : KonanBackendContext() {
|
||||
|
||||
val debug = true
|
||||
|
||||
var moduleDescriptor: ModuleDescriptor? = null
|
||||
|
||||
// TODO: make lateinit?
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@ internal class CodeGenerator(override val context: Context) : ContextUtils {
|
||||
prologue(llvmFunction,
|
||||
LLVMGetReturnType(getLlvmFunctionType(descriptor))!!)
|
||||
|
||||
if (!descriptor.isExported() && !context.debug) {
|
||||
LLVMSetLinkage(llvmFunction, LLVMLinkage.LLVMPrivateLinkage)
|
||||
if (!descriptor.isExported()) {
|
||||
LLVMSetLinkage(llvmFunction, LLVMLinkage.LLVMInternalLinkage)
|
||||
// (Cannot do this before the function body is created).
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -614,7 +614,7 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid
|
||||
context.llvm.fileInitializers.add(expression)
|
||||
}
|
||||
|
||||
LLVMSetLinkage(globalProperty, LLVMLinkage.LLVMPrivateLinkage)
|
||||
LLVMSetLinkage(globalProperty, LLVMLinkage.LLVMInternalLinkage)
|
||||
// (Cannot do this before the global is initialized).
|
||||
|
||||
return
|
||||
|
||||
+1
-1
@@ -239,7 +239,7 @@ private class DeclarationsGeneratorVisitor(override val context: Context) :
|
||||
typeInfoSymbolName)!!
|
||||
|
||||
if (!descriptor.isExported()) {
|
||||
LLVMSetLinkage(llvmTypeInfoPtr, LLVMLinkage.LLVMPrivateLinkage)
|
||||
LLVMSetLinkage(llvmTypeInfoPtr, LLVMLinkage.LLVMInternalLinkage)
|
||||
}
|
||||
|
||||
typeInfoPtr = constPointer(llvmTypeInfoPtr)
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ internal class StaticData(override val context: Context): ContextUtils {
|
||||
val llvmGlobal = LLVMAddGlobal(module, type, name)!!
|
||||
|
||||
if (!isExported) {
|
||||
LLVMSetLinkage(llvmGlobal, LLVMLinkage.LLVMPrivateLinkage)
|
||||
LLVMSetLinkage(llvmGlobal, LLVMLinkage.LLVMInternalLinkage)
|
||||
}
|
||||
|
||||
return llvmGlobal
|
||||
|
||||
Reference in New Issue
Block a user