Windows: Map export to DLL storage classes for data too

Not just functions. Fixes issue #2437.
This commit is contained in:
Martin 2017-12-04 21:51:07 +01:00 committed by David Nadlinger
parent eed0faae55
commit eb8b150be0
3 changed files with 15 additions and 9 deletions

View file

@ -896,13 +896,11 @@ void DtoResolveVariable(VarDeclaration *vd) {
// as well).
gvar->setAlignment(DtoAlignment(vd));
/* TODO: set DLL storage class when `export` is fixed (an attribute)
// Windows: initialize DLL storage class with `dllimport` for `export`ed
// symbols
if (global.params.isWindows && vd->isExport()) {
auto c = vd->isImportedSymbol() ? LLGlobalValue::DLLImportStorageClass
: LLGlobalValue::DLLExportStorageClass;
gvar->setDLLStorageClass(c);
gvar->setDLLStorageClass(LLGlobalValue::DLLImportStorageClass);
}
*/
applyVarDeclUDAs(vd, gvar);
if (varIr->dynamicCompileConst) {