Skip to content

Commit c118fe2

Browse files
committed
---
yaml --- r: 2551 b: refs/heads/master c: f77c5ba h: refs/heads/master i: 2549: 7744591 2547: 86535bb 2543: ce9ee99 v: v3
1 parent 56cb53b commit c118fe2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 8eaafdaa2d39e7f28885e527aa125759fd146d51
2+
refs/heads/master: f77c5ba512687835fac4f0f1273c855d6d416c37

trunk/src/comp/middle/trans.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,8 @@ fn decl_fastcall_fn(ModuleRef llmod, &str name, TypeRef llty) -> ValueRef {
10391039
ret decl_fn(llmod, name, lib::llvm::LLVMFastCallConv, llty);
10401040
}
10411041

1042+
// Only use this if you are going to actually define the function. It's
1043+
// not valid to simply declare a function as internal.
10421044
fn decl_internal_fastcall_fn(ModuleRef llmod,
10431045
&str name, TypeRef llty) -> ValueRef {
10441046
auto llfn = decl_fn(llmod, name, lib::llvm::LLVMFastCallConv, llty);
@@ -1861,7 +1863,7 @@ fn declare_generic_glue(&@local_ctxt cx,
18611863
} else {
18621864
fn_nm = mangle_name_by_seq(cx.ccx, cx.path, "glue_" + name);
18631865
}
1864-
auto llfn = decl_internal_fastcall_fn(cx.ccx.llmod, fn_nm, llfnty);
1866+
auto llfn = decl_fastcall_fn(cx.ccx.llmod, fn_nm, llfnty);
18651867
ret llfn;
18661868
}
18671869

@@ -1872,6 +1874,9 @@ fn make_generic_glue(&@local_ctxt cx,
18721874
&vec[uint] ty_params) -> ValueRef {
18731875
auto fcx = new_fn_ctxt(cx, llfn);
18741876

1877+
llvm::LLVMSetLinkage(llfn, lib::llvm::LLVMInternalLinkage
1878+
as llvm::Linkage);
1879+
18751880
cx.ccx.stats.n_glues_created += 1u;
18761881

18771882
// Any nontrivial glue is with values passed *by alias*; this is a

0 commit comments

Comments
 (0)