summaryrefslogtreecommitdiff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index d8524a3d..983ee4dd 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -3377,12 +3377,6 @@ impl CodeGenerator for Function {
attributes.push(attributes::doc(comment));
}
- if let Some(mangled) = mangled_name {
- attributes.push(attributes::link_name(mangled));
- } else if name != canonical_name {
- attributes.push(attributes::link_name(name));
- }
-
// Handle overloaded functions by giving each overload its own unique
// suffix.
let times_seen = result.overload_number(&canonical_name);
@@ -3390,6 +3384,14 @@ impl CodeGenerator for Function {
write!(&mut canonical_name, "{}", times_seen).unwrap();
}
+ if let Some(mangled) = mangled_name {
+ if canonical_name != mangled {
+ attributes.push(attributes::link_name(mangled));
+ }
+ } else if name != canonical_name {
+ attributes.push(attributes::link_name(name));
+ }
+
let abi = match signature.abi() {
Abi::ThisCall if !ctx.options().rust_features().thiscall_abi => {
warn!("Skipping function with thiscall ABI that isn't supported by the configured Rust target");