Get rid of native_library projection queries

They don't seem particularly useful as I don't expect
native libraries to change frequently.
This commit is contained in:
nils 2022-10-18 16:55:32 +02:00
parent d7dd01fe8b
commit ccc54613c3
No known key found for this signature in database
7 changed files with 18 additions and 25 deletions

View file

@ -332,7 +332,10 @@ impl<'ll> CodegenCx<'ll, '_> {
}
}
if self.use_dll_storage_attrs && self.tcx.is_dllimport_foreign_item(def_id) {
if self.use_dll_storage_attrs
&& let Some(library) = self.tcx.native_library(def_id)
&& library.kind.is_dllimport()
{
// For foreign (native) libs we know the exact storage type to use.
unsafe {
llvm::LLVMSetDLLStorageClass(g, llvm::DLLStorageClass::DllImport);