about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-12-20 16:24:12 +0000
committerbors <bors@rust-lang.org>2019-12-20 16:24:12 +0000
commit01a46509a4c2dc430ebebf940a26232fdaeeba81 (patch)
tree4e6f0da977dffdce7073fdf1a681986d7b38650b /src/librustc_codegen_llvm
parent6b561b4917e803c4be4ca44d8e552b680cb9e380 (diff)
parent43d1532cd7c2d03e8af3e7179edccd89e989897f (diff)
downloadrust-01a46509a4c2dc430ebebf940a26232fdaeeba81.tar.gz
rust-01a46509a4c2dc430ebebf940a26232fdaeeba81.zip
Auto merge of #67455 - Centril:rollup-mf0yc81, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #64588 (Add a raw "address of" operator)
 - #67031 (Update tokio crates to latest versions)
 - #67131 (Merge `TraitItem` & `ImplItem into `AssocItem`)
 - #67354 (Fix pointing at arg when cause is outside of call)
 - #67363 (Fix handling of wasm import modules and names)

Failed merges:

r? @ghost
Diffstat (limited to 'src/librustc_codegen_llvm')
-rw-r--r--src/librustc_codegen_llvm/attributes.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/attributes.rs b/src/librustc_codegen_llvm/attributes.rs
index 5479a1f3144..3f2a51b45bd 100644
--- a/src/librustc_codegen_llvm/attributes.rs
+++ b/src/librustc_codegen_llvm/attributes.rs
@@ -344,6 +344,17 @@ pub fn from_fn_attrs(
                 const_cstr!("wasm-import-module"),
                 &module,
             );
+
+            let name = codegen_fn_attrs.link_name.unwrap_or_else(|| {
+                cx.tcx.item_name(instance.def_id())
+            });
+            let name = CString::new(&name.as_str()[..]).unwrap();
+            llvm::AddFunctionAttrStringValue(
+                llfn,
+                llvm::AttributePlace::Function,
+                const_cstr!("wasm-import-name"),
+                &name,
+            );
         }
     }
 }