@@ -1039,6 +1039,8 @@ fn decl_fastcall_fn(ModuleRef llmod, &str name, TypeRef llty) -> ValueRef {
1039
1039
ret decl_fn ( llmod, name, lib:: llvm:: LLVMFastCallConv , llty) ;
1040
1040
}
1041
1041
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.
1042
1044
fn decl_internal_fastcall_fn ( ModuleRef llmod,
1043
1045
& str name , TypeRef llty) -> ValueRef {
1044
1046
auto llfn = decl_fn ( llmod, name, lib:: llvm:: LLVMFastCallConv , llty) ;
@@ -1861,7 +1863,7 @@ fn declare_generic_glue(&@local_ctxt cx,
1861
1863
} else {
1862
1864
fn_nm = mangle_name_by_seq( cx. ccx, cx. path, "glue_" + name) ;
1863
1865
}
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) ;
1865
1867
ret llfn;
1866
1868
}
1867
1869
@@ -1872,6 +1874,9 @@ fn make_generic_glue(&@local_ctxt cx,
1872
1874
& vec[ uint] ty_params) -> ValueRef {
1873
1875
auto fcx = new_fn_ctxt( cx, llfn) ;
1874
1876
1877
+ llvm : : LLVMSetLinkage ( llfn, lib:: llvm:: LLVMInternalLinkage
1878
+ as llvm:: Linkage ) ;
1879
+
1875
1880
cx. ccx. stats. n_glues_created += 1 u;
1876
1881
1877
1882
// Any nontrivial glue is with values passed *by alias*; this is a
0 commit comments