2011-07-08 00:18:38 -05:00
|
|
|
import driver::session;
|
|
|
|
import syntax::ast;
|
|
|
|
import middle::ty;
|
|
|
|
import std::io;
|
|
|
|
|
|
|
|
fn get_symbol(session::session sess, ast::def_id def) -> str {
|
2011-07-08 00:30:07 -05:00
|
|
|
auto cnum = def._0;
|
|
|
|
auto node_id = def._1;
|
|
|
|
auto cstore = sess.get_cstore();
|
|
|
|
auto cdata = cstore::get_crate_data(cstore, cnum).data;
|
|
|
|
ret decoder::get_symbol(cdata, node_id);
|
2011-07-08 00:18:38 -05:00
|
|
|
}
|
|
|
|
|
2011-07-08 00:30:07 -05:00
|
|
|
fn get_tag_variants(ty::ctxt tcx, ast::def_id def) -> ty::variant_info[] {
|
|
|
|
decoder::get_tag_variants(tcx, def)
|
2011-07-08 00:18:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn get_type(ty::ctxt tcx, ast::def_id def) -> ty::ty_param_count_and_ty {
|
|
|
|
decoder::get_type(tcx, def)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_type_param_count(ty::ctxt tcx, &ast::def_id def) -> uint {
|
2011-07-08 00:30:07 -05:00
|
|
|
auto cnum = def._0;
|
|
|
|
auto node_id = def._1;
|
|
|
|
auto cstore = tcx.sess.get_cstore();
|
|
|
|
auto cdata = cstore::get_crate_data(cstore, cnum).data;
|
|
|
|
ret decoder::get_type_param_count(cdata, node_id);
|
2011-07-08 00:18:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn lookup_defs(session::session sess, ast::crate_num cnum,
|
|
|
|
vec[ast::ident] path) -> vec[ast::def] {
|
2011-07-08 00:30:07 -05:00
|
|
|
auto cstore = sess.get_cstore();
|
|
|
|
auto cdata = cstore::get_crate_data(cstore, cnum).data;
|
|
|
|
ret decoder::lookup_defs(cdata, cnum, path);
|
2011-07-08 00:18:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Local Variables:
|
|
|
|
// mode: rust
|
|
|
|
// fill-column: 78;
|
|
|
|
// indent-tabs-mode: nil
|
|
|
|
// c-basic-offset: 4
|
|
|
|
// buffer-file-coding-system: utf-8-unix
|
|
|
|
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
|
|
|
|
// End:
|