Skip to content

Commit 0116053

Browse files
committed
---
yaml --- r: 96187 b: refs/heads/dist-snap c: 5b534e4 h: refs/heads/master i: 96185: c66ca0c 96183: c91f76a v: v3
1 parent 44c55db commit 0116053

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 50fb4be1cce008ef8c0b4b40e70460c1be1d795a
9+
refs/heads/dist-snap: 5b534e4a22d914e284c650f4504789c2678961bd
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/middle/trans/foreign.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,19 @@ pub fn register_rust_fn_with_foreign_abi(ccx: @mut CrateContext,
399399

400400
let tys = foreign_types_for_id(ccx, node_id);
401401
let llfn_ty = lltype_for_fn_from_foreign_types(&tys);
402+
let t = ty::node_id_to_type(ccx.tcx, node_id);
403+
let cconv = match ty::get(t).sty {
404+
ty::ty_bare_fn(ref fn_ty) => {
405+
let c = llvm_calling_convention(ccx, fn_ty.abis);
406+
c.unwrap_or(lib::llvm::CCallConv)
407+
}
408+
_ => lib::llvm::CCallConv
409+
};
402410
let llfn = base::register_fn_llvmty(ccx,
403411
sp,
404412
sym,
405413
node_id,
406-
lib::llvm::CCallConv,
414+
cconv,
407415
llfn_ty);
408416
add_argument_attributes(&tys, llfn);
409417
debug!("register_rust_fn_with_foreign_abi(node_id={:?}, llfn_ty={}, llfn={})",

0 commit comments

Comments
 (0)