rust/src/comp/middle/trans_impl.rs

22 lines
656 B
Rust
Raw Normal View History

2012-01-02 05:21:44 -06:00
import trans::*;
import trans_common::*;
import trans_build::*;
2012-01-02 05:21:44 -06:00
import option::{some, none};
import syntax::ast;
import lib::llvm;
2012-01-02 05:21:44 -06:00
fn trans_impl(cx: @local_ctxt, name: ast::ident, methods: [@ast::method],
id: ast::node_id, tps: [ast::ty_param],
_ifce: option::t<@ast::ty>) {
2012-01-02 05:21:44 -06:00
let sub_cx = extend_path(cx, name);
for m in methods {
alt cx.ccx.item_ids.find(m.id) {
some(llfn) {
trans_fn(extend_path(sub_cx, m.ident), m.span, m.decl, m.body,
llfn, impl_self(ty::node_id_to_monotype(cx.ccx.tcx, id)),
tps + m.tps, m.id);
}
}
}
}