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

@ -179,7 +179,8 @@ pub fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) ->
// MinGW: For backward compatibility we rely on the linker to decide whether it
// should use dllimport for functions.
if cx.use_dll_storage_attrs
&& tcx.is_dllimport_foreign_item(instance_def_id)
&& let Some(library) = tcx.native_library(instance_def_id)
&& library.kind.is_dllimport()
&& !matches!(tcx.sess.target.env.as_ref(), "gnu" | "uclibc")
{
llvm::LLVMSetDLLStorageClass(llfn, llvm::DLLStorageClass::DllImport);