Skip to content

Commit 36340ba

Browse files
committed
rustc: move mir::repr::* to mir.
1 parent 5530030 commit 36340ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+155
-170
lines changed

src/librustc/lib.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,7 @@ pub mod middle {
105105
pub mod weak_lang_items;
106106
}
107107

108-
pub mod mir {
109-
mod cache;
110-
pub mod repr;
111-
pub mod tcx;
112-
pub mod visit;
113-
pub mod transform;
114-
pub mod traversal;
115-
pub mod mir_map;
116-
}
117-
108+
pub mod mir;
118109
pub mod session;
119110
pub mod traits;
120111
pub mod ty;

src/librustc/middle/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use hir::map::definitions::{Definitions, DefKey};
2929
use hir::svh::Svh;
3030
use middle::lang_items;
3131
use ty::{self, Ty, TyCtxt};
32-
use mir::repr::Mir;
32+
use mir::Mir;
3333
use mir::mir_map::MirMap;
3434
use session::Session;
3535
use session::search_paths::PathKind;

src/librustc/mir/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use std::cell::{Ref, RefCell};
1212
use rustc_data_structures::indexed_vec::IndexVec;
1313

14-
use mir::repr::{Mir, BasicBlock};
14+
use mir::{Mir, BasicBlock};
1515

1616
use rustc_serialize as serialize;
1717

src/librustc/mir/mir_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use dep_graph::{DepGraph, DepNode, DepTrackingMap, DepTrackingMapConfig};
1212
use hir::def_id::DefId;
13-
use mir::repr::Mir;
13+
use mir::Mir;
1414
use std::marker::PhantomData;
1515

1616
pub struct MirMap<'tcx> {

src/librustc/mir/repr.rs renamed to src/librustc/mir/mod.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ use std::vec::IntoIter;
3232
use syntax::ast::{self, Name};
3333
use syntax_pos::Span;
3434

35-
use super::cache::Cache;
35+
mod cache;
36+
pub mod tcx;
37+
pub mod visit;
38+
pub mod transform;
39+
pub mod traversal;
40+
pub mod mir_map;
3641

3742
macro_rules! newtype_index {
3843
($name:ident, $debug_name:expr) => (
@@ -106,7 +111,7 @@ pub struct Mir<'tcx> {
106111
pub span: Span,
107112

108113
/// A cache for various calculations
109-
cache: Cache
114+
cache: cache::Cache
110115
}
111116

112117
/// where execution begins
@@ -137,7 +142,7 @@ impl<'tcx> Mir<'tcx> {
137142
upvar_decls: upvar_decls,
138143
spread_arg: None,
139144
span: span,
140-
cache: Cache::new()
145+
cache: cache::Cache::new()
141146
}
142147
}
143148

src/librustc/mir/tcx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* building is complete.
1414
*/
1515

16-
use mir::repr::*;
16+
use mir::*;
1717
use ty::subst::{Subst, Substs};
1818
use ty::{self, AdtDef, Ty, TyCtxt};
1919
use ty::fold::{TypeFoldable, TypeFolder, TypeVisitor};

src/librustc/mir/transform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use dep_graph::DepNode;
1212
use hir;
1313
use hir::map::DefPathData;
1414
use mir::mir_map::MirMap;
15-
use mir::repr::{Mir, Promoted};
15+
use mir::{Mir, Promoted};
1616
use ty::TyCtxt;
1717
use syntax::ast::NodeId;
1818
use util::common::time;

src/librustc/mir/traversal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::vec;
1313
use rustc_data_structures::bitvec::BitVector;
1414
use rustc_data_structures::indexed_vec::Idx;
1515

16-
use super::repr::*;
16+
use super::*;
1717

1818
/// Preorder traversal of a graph.
1919
///

src/librustc/mir/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use middle::const_val::ConstVal;
1212
use hir::def_id::DefId;
1313
use ty::subst::Substs;
1414
use ty::{ClosureSubsts, Region, Ty};
15-
use mir::repr::*;
15+
use mir::*;
1616
use rustc_const_math::ConstUsize;
1717
use rustc_data_structures::tuple_slice::TupleSlice;
1818
use rustc_data_structures::indexed_vec::Idx;

src/librustc_borrowck/borrowck/mir/abs_domain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
//! `a[x]` would still overlap them both. But that is not this
2222
//! representation does today.)
2323
24-
use rustc::mir::repr::{Lvalue, LvalueElem};
25-
use rustc::mir::repr::{Operand, Projection, ProjectionElem};
24+
use rustc::mir::{Lvalue, LvalueElem};
25+
use rustc::mir::{Operand, Projection, ProjectionElem};
2626

2727
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
2828
pub struct AbstractOperand;

src/librustc_borrowck/borrowck/mir/dataflow/graphviz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Hook into libgraphviz for rendering dataflow graphs for MIR.
1212
1313
use syntax::ast::NodeId;
14-
use rustc::mir::repr::{BasicBlock, Mir};
14+
use rustc::mir::{BasicBlock, Mir};
1515
use rustc_data_structures::bitslice::bits_to_string;
1616
use rustc_data_structures::indexed_set::{IdxSet};
1717
use rustc_data_structures::indexed_vec::Idx;

src/librustc_borrowck/borrowck/mir/dataflow/impls.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use rustc::ty::TyCtxt;
12-
use rustc::mir::repr::{self, Mir, Location};
12+
use rustc::mir::{self, Mir, Location};
1313
use rustc_data_structures::bitslice::BitSlice; // adds set_bit/get_bit to &[usize] bitvector rep.
1414
use rustc_data_structures::bitslice::{BitwiseOperator};
1515
use rustc_data_structures::indexed_set::{IdxSet};
@@ -245,7 +245,7 @@ impl<'a, 'tcx> BitDenotation for MaybeInitializedLvals<'a, 'tcx> {
245245
fn statement_effect(&self,
246246
ctxt: &Self::Ctxt,
247247
sets: &mut BlockSets<MovePathIndex>,
248-
bb: repr::BasicBlock,
248+
bb: mir::BasicBlock,
249249
idx: usize)
250250
{
251251
drop_flag_effects_for_location(
@@ -258,7 +258,7 @@ impl<'a, 'tcx> BitDenotation for MaybeInitializedLvals<'a, 'tcx> {
258258
fn terminator_effect(&self,
259259
ctxt: &Self::Ctxt,
260260
sets: &mut BlockSets<MovePathIndex>,
261-
bb: repr::BasicBlock,
261+
bb: mir::BasicBlock,
262262
statements_len: usize)
263263
{
264264
drop_flag_effects_for_location(
@@ -271,9 +271,9 @@ impl<'a, 'tcx> BitDenotation for MaybeInitializedLvals<'a, 'tcx> {
271271
fn propagate_call_return(&self,
272272
ctxt: &Self::Ctxt,
273273
in_out: &mut IdxSet<MovePathIndex>,
274-
_call_bb: repr::BasicBlock,
275-
_dest_bb: repr::BasicBlock,
276-
dest_lval: &repr::Lvalue) {
274+
_call_bb: mir::BasicBlock,
275+
_dest_bb: mir::BasicBlock,
276+
dest_lval: &mir::Lvalue) {
277277
// when a call returns successfully, that means we need to set
278278
// the bits for that dest_lval to 1 (initialized).
279279
on_lookup_result_bits(self.tcx, self.mir, &ctxt.move_data,
@@ -306,7 +306,7 @@ impl<'a, 'tcx> BitDenotation for MaybeUninitializedLvals<'a, 'tcx> {
306306
fn statement_effect(&self,
307307
ctxt: &Self::Ctxt,
308308
sets: &mut BlockSets<MovePathIndex>,
309-
bb: repr::BasicBlock,
309+
bb: mir::BasicBlock,
310310
idx: usize)
311311
{
312312
drop_flag_effects_for_location(
@@ -319,7 +319,7 @@ impl<'a, 'tcx> BitDenotation for MaybeUninitializedLvals<'a, 'tcx> {
319319
fn terminator_effect(&self,
320320
ctxt: &Self::Ctxt,
321321
sets: &mut BlockSets<MovePathIndex>,
322-
bb: repr::BasicBlock,
322+
bb: mir::BasicBlock,
323323
statements_len: usize)
324324
{
325325
drop_flag_effects_for_location(
@@ -332,9 +332,9 @@ impl<'a, 'tcx> BitDenotation for MaybeUninitializedLvals<'a, 'tcx> {
332332
fn propagate_call_return(&self,
333333
ctxt: &Self::Ctxt,
334334
in_out: &mut IdxSet<MovePathIndex>,
335-
_call_bb: repr::BasicBlock,
336-
_dest_bb: repr::BasicBlock,
337-
dest_lval: &repr::Lvalue) {
335+
_call_bb: mir::BasicBlock,
336+
_dest_bb: mir::BasicBlock,
337+
dest_lval: &mir::Lvalue) {
338338
// when a call returns successfully, that means we need to set
339339
// the bits for that dest_lval to 0 (initialized).
340340
on_lookup_result_bits(self.tcx, self.mir, &ctxt.move_data,
@@ -366,7 +366,7 @@ impl<'a, 'tcx> BitDenotation for DefinitelyInitializedLvals<'a, 'tcx> {
366366
fn statement_effect(&self,
367367
ctxt: &Self::Ctxt,
368368
sets: &mut BlockSets<MovePathIndex>,
369-
bb: repr::BasicBlock,
369+
bb: mir::BasicBlock,
370370
idx: usize)
371371
{
372372
drop_flag_effects_for_location(
@@ -379,7 +379,7 @@ impl<'a, 'tcx> BitDenotation for DefinitelyInitializedLvals<'a, 'tcx> {
379379
fn terminator_effect(&self,
380380
ctxt: &Self::Ctxt,
381381
sets: &mut BlockSets<MovePathIndex>,
382-
bb: repr::BasicBlock,
382+
bb: mir::BasicBlock,
383383
statements_len: usize)
384384
{
385385
drop_flag_effects_for_location(
@@ -392,9 +392,9 @@ impl<'a, 'tcx> BitDenotation for DefinitelyInitializedLvals<'a, 'tcx> {
392392
fn propagate_call_return(&self,
393393
ctxt: &Self::Ctxt,
394394
in_out: &mut IdxSet<MovePathIndex>,
395-
_call_bb: repr::BasicBlock,
396-
_dest_bb: repr::BasicBlock,
397-
dest_lval: &repr::Lvalue) {
395+
_call_bb: mir::BasicBlock,
396+
_dest_bb: mir::BasicBlock,
397+
dest_lval: &mir::Lvalue) {
398398
// when a call returns successfully, that means we need to set
399399
// the bits for that dest_lval to 1 (initialized).
400400
on_lookup_result_bits(self.tcx, self.mir, &ctxt.move_data,
@@ -418,7 +418,7 @@ impl<'a, 'tcx> BitDenotation for MovingOutStatements<'a, 'tcx> {
418418
fn statement_effect(&self,
419419
ctxt: &Self::Ctxt,
420420
sets: &mut BlockSets<MoveOutIndex>,
421-
bb: repr::BasicBlock,
421+
bb: mir::BasicBlock,
422422
idx: usize) {
423423
let (tcx, mir, move_data) = (self.tcx, self.mir, &ctxt.move_data);
424424
let stmt = &mir[bb].statements[idx];
@@ -437,10 +437,10 @@ impl<'a, 'tcx> BitDenotation for MovingOutStatements<'a, 'tcx> {
437437
}
438438
let bits_per_block = self.bits_per_block(ctxt);
439439
match stmt.kind {
440-
repr::StatementKind::SetDiscriminant { .. } => {
440+
mir::StatementKind::SetDiscriminant { .. } => {
441441
span_bug!(stmt.source_info.span, "SetDiscriminant should not exist in borrowck");
442442
}
443-
repr::StatementKind::Assign(ref lvalue, _) => {
443+
mir::StatementKind::Assign(ref lvalue, _) => {
444444
// assigning into this `lvalue` kills all
445445
// MoveOuts from it, and *also* all MoveOuts
446446
// for children and associated fragment sets.
@@ -453,16 +453,16 @@ impl<'a, 'tcx> BitDenotation for MovingOutStatements<'a, 'tcx> {
453453
sets.kill_set.add(&moi);
454454
});
455455
}
456-
repr::StatementKind::StorageLive(_) |
457-
repr::StatementKind::StorageDead(_) |
458-
repr::StatementKind::Nop => {}
456+
mir::StatementKind::StorageLive(_) |
457+
mir::StatementKind::StorageDead(_) |
458+
mir::StatementKind::Nop => {}
459459
}
460460
}
461461

462462
fn terminator_effect(&self,
463463
ctxt: &Self::Ctxt,
464464
sets: &mut BlockSets<MoveOutIndex>,
465-
bb: repr::BasicBlock,
465+
bb: mir::BasicBlock,
466466
statements_len: usize)
467467
{
468468
let (mir, move_data) = (self.mir, &ctxt.move_data);
@@ -481,9 +481,9 @@ impl<'a, 'tcx> BitDenotation for MovingOutStatements<'a, 'tcx> {
481481
fn propagate_call_return(&self,
482482
ctxt: &Self::Ctxt,
483483
in_out: &mut IdxSet<MoveOutIndex>,
484-
_call_bb: repr::BasicBlock,
485-
_dest_bb: repr::BasicBlock,
486-
dest_lval: &repr::Lvalue) {
484+
_call_bb: mir::BasicBlock,
485+
_dest_bb: mir::BasicBlock,
486+
dest_lval: &mir::Lvalue) {
487487
let move_data = &ctxt.move_data;
488488
let bits_per_block = self.bits_per_block(ctxt);
489489

0 commit comments

Comments
 (0)