Remove expn_info box typedef from codemap

This commit is contained in:
Brian Anderson 2012-11-12 17:19:56 -08:00
parent 18a825bda0
commit d115944809
2 changed files with 11 additions and 8 deletions

View File

@ -39,7 +39,11 @@ export loc;
export get_filemap; export get_filemap;
export new_codemap; export new_codemap;
struct span {lo: uint, hi: uint, expn_info: expn_info} struct span {
lo: uint,
hi: uint,
expn_info: Option<@expn_info>
}
impl span : cmp::Eq { impl span : cmp::Eq {
pure fn eq(other: &span) -> bool { pure fn eq(other: &span) -> bool {
@ -59,11 +63,10 @@ impl<D: Deserializer> span: Deserializable<D> {
} }
} }
enum expn_info_ { enum expn_info {
expanded_from({call_site: span, expanded_from({call_site: span,
callie: {name: ~str, span: Option<span>}}) callie: {name: ~str, span: Option<span>}})
} }
type expn_info = Option<@expn_info_>;
type filename = ~str; type filename = ~str;

View File

@ -129,11 +129,11 @@ trait ext_ctxt {
fn parse_sess() -> parse::parse_sess; fn parse_sess() -> parse::parse_sess;
fn cfg() -> ast::crate_cfg; fn cfg() -> ast::crate_cfg;
fn print_backtrace(); fn print_backtrace();
fn backtrace() -> expn_info; fn backtrace() -> Option<@expn_info>;
fn mod_push(mod_name: ast::ident); fn mod_push(mod_name: ast::ident);
fn mod_pop(); fn mod_pop();
fn mod_path() -> ~[ast::ident]; fn mod_path() -> ~[ast::ident];
fn bt_push(ei: codemap::expn_info_); fn bt_push(ei: codemap::expn_info);
fn bt_pop(); fn bt_pop();
fn span_fatal(sp: span, msg: &str) -> !; fn span_fatal(sp: span, msg: &str) -> !;
fn span_err(sp: span, msg: &str); fn span_err(sp: span, msg: &str);
@ -153,7 +153,7 @@ fn mk_ctxt(parse_sess: parse::parse_sess,
cfg: ast::crate_cfg) -> ext_ctxt { cfg: ast::crate_cfg) -> ext_ctxt {
type ctxt_repr = {parse_sess: parse::parse_sess, type ctxt_repr = {parse_sess: parse::parse_sess,
cfg: ast::crate_cfg, cfg: ast::crate_cfg,
mut backtrace: expn_info, mut backtrace: Option<@expn_info>,
mut mod_path: ~[ast::ident], mut mod_path: ~[ast::ident],
mut trace_mac: bool}; mut trace_mac: bool};
impl ctxt_repr: ext_ctxt { impl ctxt_repr: ext_ctxt {
@ -161,11 +161,11 @@ fn mk_ctxt(parse_sess: parse::parse_sess,
fn parse_sess() -> parse::parse_sess { self.parse_sess } fn parse_sess() -> parse::parse_sess { self.parse_sess }
fn cfg() -> ast::crate_cfg { self.cfg } fn cfg() -> ast::crate_cfg { self.cfg }
fn print_backtrace() { } fn print_backtrace() { }
fn backtrace() -> expn_info { self.backtrace } fn backtrace() -> Option<@expn_info> { self.backtrace }
fn mod_push(i: ast::ident) { self.mod_path.push(i); } fn mod_push(i: ast::ident) { self.mod_path.push(i); }
fn mod_pop() { self.mod_path.pop(); } fn mod_pop() { self.mod_path.pop(); }
fn mod_path() -> ~[ast::ident] { return self.mod_path; } fn mod_path() -> ~[ast::ident] { return self.mod_path; }
fn bt_push(ei: codemap::expn_info_) { fn bt_push(ei: codemap::expn_info) {
match ei { match ei {
expanded_from({call_site: cs, callie: callie}) => { expanded_from({call_site: cs, callie: callie}) => {
self.backtrace = self.backtrace =