2012-01-02 05:21:44 -06:00
|
|
|
import trans::*;
|
|
|
|
import trans_common::*;
|
2012-01-02 05:58:31 -06:00
|
|
|
import trans_build::*;
|
2012-01-02 05:21:44 -06:00
|
|
|
import option::{some, none};
|
|
|
|
import syntax::ast;
|
2012-01-02 05:58:31 -06:00
|
|
|
import lib::llvm;
|
2012-01-02 05:21:44 -06:00
|
|
|
|
|
|
|
fn trans_impl(cx: @local_ctxt, name: ast::ident, methods: [@ast::method],
|
2012-01-02 05:58:31 -06:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|