Skip to content

Commit ebe0b42

Browse files
committed
---
yaml --- r: 277501 b: refs/heads/try c: ca88c44 h: refs/heads/master i: 277499: 977d131
1 parent 9751fdf commit ebe0b42

File tree

5 files changed

+12
-29
lines changed

5 files changed

+12
-29
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 02df9f32b1947fe194e2844a11db454b9763ea92
4+
refs/heads/try: ca88c44a9092c22ce39797e9b19ed6f7bb179ada
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc_driver/driver.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ pub fn compile_input(sess: &Session,
165165
&hir_map,
166166
&expanded_crate,
167167
&hir_map.krate(),
168-
&id[..],
169-
&lcx),
168+
&id[..]),
170169
Ok(()));
171170
}
172171

@@ -203,7 +202,6 @@ pub fn compile_input(sess: &Session,
203202
&analysis,
204203
mir_map.as_ref(),
205204
tcx,
206-
&lcx,
207205
&id);
208206
(control.after_analysis.callback)(state);
209207

@@ -345,7 +343,6 @@ pub struct CompileState<'a, 'ast: 'a, 'tcx: 'a> {
345343
pub mir_map: Option<&'a MirMap<'tcx>>,
346344
pub analysis: Option<&'a ty::CrateAnalysis<'a>>,
347345
pub tcx: Option<&'a TyCtxt<'tcx>>,
348-
pub lcx: Option<&'a LoweringContext<'a>>,
349346
pub trans: Option<&'a trans::CrateTranslation>,
350347
}
351348

@@ -368,7 +365,6 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
368365
analysis: None,
369366
mir_map: None,
370367
tcx: None,
371-
lcx: None,
372368
trans: None,
373369
}
374370
}
@@ -400,15 +396,13 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
400396
hir_map: &'a hir_map::Map<'ast>,
401397
krate: &'a ast::Crate,
402398
hir_crate: &'a hir::Crate,
403-
crate_name: &'a str,
404-
lcx: &'a LoweringContext<'a>)
399+
crate_name: &'a str)
405400
-> CompileState<'a, 'ast, 'tcx> {
406401
CompileState {
407402
crate_name: Some(crate_name),
408403
ast_map: Some(hir_map),
409404
krate: Some(krate),
410405
hir_crate: Some(hir_crate),
411-
lcx: Some(lcx),
412406
..CompileState::empty(input, session, out_dir)
413407
}
414408
}
@@ -421,7 +415,6 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
421415
analysis: &'a ty::CrateAnalysis,
422416
mir_map: Option<&'a MirMap<'tcx>>,
423417
tcx: &'a TyCtxt<'tcx>,
424-
lcx: &'a LoweringContext<'a>,
425418
crate_name: &'a str)
426419
-> CompileState<'a, 'ast, 'tcx> {
427420
CompileState {
@@ -430,7 +423,6 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
430423
tcx: Some(tcx),
431424
krate: krate,
432425
hir_crate: Some(hir_crate),
433-
lcx: Some(lcx),
434426
crate_name: Some(crate_name),
435427
..CompileState::empty(input, session, out_dir)
436428
}

branches/try/src/librustc_driver/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,6 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
499499
control.after_analysis.callback = box |state| {
500500
time(state.session.time_passes(), "save analysis", || {
501501
save::process_crate(state.tcx.unwrap(),
502-
state.lcx.unwrap(),
503502
state.krate.unwrap(),
504503
state.analysis.unwrap(),
505504
state.crate_name.unwrap(),

branches/try/src/librustc_save_analysis/dump_visitor.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ use syntax::visit::{self, Visitor};
4242
use syntax::print::pprust::{path_to_string, ty_to_string};
4343
use syntax::ptr::P;
4444

45-
use rustc::hir::lowering::lower_expr;
46-
4745
use super::{escape, generated_code, SaveContext, PathCollector};
4846
use super::data::*;
4947
use super::dump::Dump;
@@ -1222,7 +1220,7 @@ impl<'v, 'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'v> for DumpVisitor<'l, 'tcx,
12221220
visit::walk_expr(self, ex);
12231221
}
12241222
ast::ExprKind::Struct(ref path, ref fields, ref base) => {
1225-
let hir_expr = lower_expr(self.save_ctxt.lcx, ex);
1223+
let hir_expr = self.save_ctxt.tcx.map.expect_expr(ex.id);
12261224
let adt = self.tcx.expr_ty(&hir_expr).ty_adt_def().unwrap();
12271225
let def = self.tcx.resolve_expr(&hir_expr);
12281226
self.process_struct_lit(ex, path, fields, adt.variant_of_def(def), base)
@@ -1241,7 +1239,7 @@ impl<'v, 'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'v> for DumpVisitor<'l, 'tcx,
12411239
ast::ExprKind::TupField(ref sub_ex, idx) => {
12421240
self.visit_expr(&sub_ex);
12431241

1244-
let hir_node = lower_expr(self.save_ctxt.lcx, sub_ex);
1242+
let hir_node = self.save_ctxt.tcx.map.expect_expr(sub_ex.id);
12451243
let ty = &self.tcx.expr_ty_adjusted(&hir_node).sty;
12461244
match *ty {
12471245
ty::TyStruct(def, _) => {

branches/try/src/librustc_save_analysis/lib.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#[macro_use] extern crate syntax;
2929
extern crate serialize as rustc_serialize;
3030

31-
use rustc::hir::{self, lowering};
31+
use rustc::hir;
3232
use rustc::hir::map::NodeItem;
3333
use rustc::hir::def::Def;
3434
use rustc::hir::def_id::DefId;
@@ -75,7 +75,6 @@ pub mod recorder {
7575

7676
pub struct SaveContext<'l, 'tcx: 'l> {
7777
tcx: &'l TyCtxt<'tcx>,
78-
lcx: &'l lowering::LoweringContext<'l>,
7978
span_utils: SpanUtils<'tcx>,
8079
}
8180

@@ -84,20 +83,16 @@ macro_rules! option_try(
8483
);
8584

8685
impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
87-
pub fn new(tcx: &'l TyCtxt<'tcx>,
88-
lcx: &'l lowering::LoweringContext<'l>)
89-
-> SaveContext<'l, 'tcx> {
86+
pub fn new(tcx: &'l TyCtxt<'tcx>) -> SaveContext<'l, 'tcx> {
9087
let span_utils = SpanUtils::new(&tcx.sess);
91-
SaveContext::from_span_utils(tcx, lcx, span_utils)
88+
SaveContext::from_span_utils(tcx, span_utils)
9289
}
9390

9491
pub fn from_span_utils(tcx: &'l TyCtxt<'tcx>,
95-
lcx: &'l lowering::LoweringContext<'l>,
9692
span_utils: SpanUtils<'tcx>)
9793
-> SaveContext<'l, 'tcx> {
9894
SaveContext {
9995
tcx: tcx,
100-
lcx: lcx,
10196
span_utils: span_utils,
10297
}
10398
}
@@ -378,14 +373,14 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
378373
}
379374

380375
pub fn get_expr_data(&self, expr: &ast::Expr) -> Option<Data> {
381-
let hir_node = lowering::lower_expr(self.lcx, expr);
376+
let hir_node = self.tcx.map.expect_expr(expr.id);
382377
let ty = self.tcx.expr_ty_adjusted_opt(&hir_node);
383378
if ty.is_none() || ty.unwrap().sty == ty::TyError {
384379
return None;
385380
}
386381
match expr.node {
387382
ast::ExprKind::Field(ref sub_ex, ident) => {
388-
let hir_node = lowering::lower_expr(self.lcx, sub_ex);
383+
let hir_node = self.tcx.map.expect_expr(sub_ex.id);
389384
match self.tcx.expr_ty_adjusted(&hir_node).sty {
390385
ty::TyStruct(def, _) => {
391386
let f = def.struct_variant().field_named(ident.node.name);
@@ -405,7 +400,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
405400
}
406401
}
407402
ast::ExprKind::Struct(ref path, _, _) => {
408-
let hir_node = lowering::lower_expr(self.lcx, expr);
403+
let hir_node = self.tcx.map.expect_expr(expr.id);
409404
match self.tcx.expr_ty_adjusted(&hir_node).sty {
410405
ty::TyStruct(def, _) => {
411406
let sub_span = self.span_utils.span_for_last_ident(path.span);
@@ -704,7 +699,6 @@ impl Format {
704699
}
705700

706701
pub fn process_crate<'l, 'tcx>(tcx: &'l TyCtxt<'tcx>,
707-
lcx: &'l lowering::LoweringContext<'l>,
708702
krate: &ast::Crate,
709703
analysis: &'l ty::CrateAnalysis<'l>,
710704
cratename: &str,
@@ -755,7 +749,7 @@ pub fn process_crate<'l, 'tcx>(tcx: &'l TyCtxt<'tcx>,
755749
let output = &mut output_file;
756750

757751
let utils: SpanUtils<'tcx> = SpanUtils::new(&tcx.sess);
758-
let save_ctxt = SaveContext::new(tcx, lcx);
752+
let save_ctxt = SaveContext::new(tcx);
759753

760754
macro_rules! dump {
761755
($new_dumper: expr) => {{

0 commit comments

Comments
 (0)