Skip to content

Commit f305724

Browse files
committed
Make the wrapper function of native functions private.
1 parent 12e7feb commit f305724

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/comp/middle/trans.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5436,6 +5436,8 @@ fn decl_native_fn_and_pair(@crate_ctxt cx,
54365436
auto wrapper_type = native_fn_wrapper_type(cx, num_ty_param, ann);
54375437
let str s = cx.names.next("_rust_wrapper") + sep() + name;
54385438
let ValueRef wrapper_fn = decl_fastcall_fn(cx.llmod, s, wrapper_type);
5439+
llvm.LLVMSetLinkage(wrapper_fn, lib.llvm.LLVMPrivateLinkage
5440+
as llvm.Linkage);
54395441

54405442
// Declare the global constant pair that points to it.
54415443
auto wrapper_pair_type = T_fn_pair(cx.tn, wrapper_type);

0 commit comments

Comments
 (0)