Merge pull request #922 from jbrodman/windll

Add DLL storage class for export functions on windows
This commit is contained in:
Dmitry Babokin
2014-12-11 11:21:10 +03:00

View File

@@ -906,6 +906,13 @@ Module::AddFunctionDeclaration(const std::string &name,
llvm::Function::Create(llvmFunctionType, linkage, functionName.c_str(), llvm::Function::Create(llvmFunctionType, linkage, functionName.c_str(),
module); module);
#ifdef ISPC_IS_WINDOWS
// Make export functions callable from DLLS.
if (functionType->isExported) {
function->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass);
}
#endif
// Set function attributes: we never throw exceptions // Set function attributes: we never throw exceptions
function->setDoesNotThrow(); function->setDoesNotThrow();
if (storageClass != SC_EXTERN_C && if (storageClass != SC_EXTERN_C &&