summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_codegen_llvm/src/callee.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:37 +0000
commit246f239d9f40f633160f0c18f87a20922d4e77bb (patch)
tree5a88572663584b3d4d28e5a20e10abab1be40884 /compiler/rustc_codegen_llvm/src/callee.rs
parentReleasing progress-linux version 1.64.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-246f239d9f40f633160f0c18f87a20922d4e77bb.tar.xz
rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.zip
Merging debian version 1.65.0+dfsg1-2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/callee.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/callee.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/callee.rs b/compiler/rustc_codegen_llvm/src/callee.rs
index 72155d874..b83c1e8f0 100644
--- a/compiler/rustc_codegen_llvm/src/callee.rs
+++ b/compiler/rustc_codegen_llvm/src/callee.rs
@@ -6,11 +6,11 @@
use crate::abi::FnAbiLlvmExt;
use crate::attributes;
+use crate::common;
use crate::context::CodegenCx;
use crate::llvm;
use crate::value::Value;
use rustc_codegen_ssa::traits::*;
-use tracing::debug;
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt};
use rustc_middle::ty::{self, Instance, TypeVisitable};
@@ -79,13 +79,18 @@ pub fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) ->
llfn
}
} else {
- let llfn = cx.declare_fn(sym, fn_abi);
+ let instance_def_id = instance.def_id();
+ let llfn = if tcx.sess.target.arch == "x86" &&
+ let Some(dllimport) = common::get_dllimport(tcx, instance_def_id, sym)
+ {
+ cx.declare_fn(&common::i686_decorated_name(&dllimport, common::is_mingw_gnu_toolchain(&tcx.sess.target), true), fn_abi)
+ } else {
+ cx.declare_fn(sym, fn_abi)
+ };
debug!("get_fn: not casting pointer!");
attributes::from_fn_attrs(cx, llfn, instance);
- let instance_def_id = instance.def_id();
-
// Apply an appropriate linkage/visibility value to our item that we
// just declared.
//