IRGen: repair the IRGen on Windows

The cross-module reference must be indirected through the moral
equivalent of the GOT - the IAT.  This indirects through the import
address table, permitting the pointer to be resolved.
This commit is contained in:
Saleem Abdulrasool
2021-04-07 14:06:16 -07:00
parent 583d617254
commit ffd9c76f86

View File

@@ -899,9 +899,8 @@ llvm::Constant *swift::getRuntimeFn(llvm::Module &Module,
}
llvm::Constant *IRGenModule::getDeletedAsyncMethodErrorAsyncFunctionPointer() {
return getAddrOfLLVMVariable(
LinkEntity::forKnownAsyncFunctionPointer("swift_deletedAsyncMethodError"),
ConstantInit(), DebugTypeInfo());
return getAddrOfLLVMVariableOrGOTEquivalent(
LinkEntity::forKnownAsyncFunctionPointer("swift_deletedAsyncMethodError")).getValue();
}
#define QUOTE(...) __VA_ARGS__