Add DLL export for exported functions on win32.

This commit is contained in:
Christoffer Lerno
2023-05-28 15:00:46 +02:00
parent d4259368a2
commit e0cfb39d79
2 changed files with 9 additions and 1 deletions

View File

@@ -1042,6 +1042,10 @@ LLVMValueRef llvm_get_ref(GenContext *c, Decl *decl)
}
assert(decl->var.kind == VARDECL_GLOBAL || decl->var.kind == VARDECL_CONST);
llvm_add_global_decl(c, decl);
if (decl->is_export && platform_target.os == OS_TYPE_WIN32)
{
LLVMSetDLLStorageClass(decl->backend_ref, LLVMDLLExportStorageClass);
}
return decl->backend_ref;
case DECL_FUNC:
if (decl->func_decl.attr_interface)
@@ -1057,6 +1061,10 @@ LLVMValueRef llvm_get_ref(GenContext *c, Decl *decl)
}
backend_ref = decl->backend_ref = LLVMAddFunction(c->module, decl_get_extname(decl), llvm_get_type(c, decl->type));
llvm_append_function_attributes(c, decl);
if (decl->is_export && platform_target.os == OS_TYPE_WIN32)
{
LLVMSetDLLStorageClass(backend_ref, LLVMDLLExportStorageClass);
}
if (decl_is_local(decl))
{
assert(decl->unit->module == c->code_module);

View File

@@ -1 +1 @@
#define COMPILER_VERSION "0.4.515"
#define COMPILER_VERSION "0.4.516"