Skip to content

Commit 78884b7

Browse files
committed
mir: qualify and promote constants.
1 parent 14efbf1 commit 78884b7

File tree

18 files changed

+1895
-784
lines changed

18 files changed

+1895
-784
lines changed

mk/crates.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ DEPS_rustc_lint := rustc log syntax rustc_const_eval
111111
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
112112
DEPS_rustc_metadata := rustc syntax rbml rustc_const_math
113113
DEPS_rustc_passes := syntax rustc core rustc_const_eval
114-
DEPS_rustc_mir := rustc syntax rustc_const_math rustc_const_eval
114+
DEPS_rustc_mir := rustc syntax rustc_const_math rustc_const_eval rustc_bitflags
115115
DEPS_rustc_resolve := arena rustc log syntax
116116
DEPS_rustc_platform_intrinsics := std
117117
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir

src/librustc_driver/driver.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use rustc_privacy;
3737
use rustc_plugin::registry::Registry;
3838
use rustc_plugin as plugin;
3939
use rustc::hir::lowering::{lower_crate, LoweringContext};
40-
use rustc_passes::{no_asm, loops, consts, const_fn, rvalues, static_recursion};
40+
use rustc_passes::{no_asm, loops, consts, rvalues, static_recursion};
4141
use rustc_const_eval::check_match;
4242
use super::Compilation;
4343

@@ -726,10 +726,6 @@ pub fn phase_2_configure_and_expand(sess: &Session,
726726
})
727727
})?;
728728

729-
time(time_passes,
730-
"const fn bodies and arguments",
731-
|| const_fn::check_crate(sess, &krate))?;
732-
733729
if sess.opts.debugging_opts.input_stats {
734730
println!("Post-expansion node count: {}", count_nodes(&krate));
735731
}
@@ -903,6 +899,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
903899
let mut passes = sess.mir_passes.borrow_mut();
904900
// Push all the built-in passes.
905901
passes.push_pass(box mir::transform::remove_dead_blocks::RemoveDeadBlocks);
902+
passes.push_pass(box mir::transform::qualify_consts::QualifyAndPromoteConstants);
906903
passes.push_pass(box mir::transform::type_check::TypeckMir);
907904
passes.push_pass(box mir::transform::simplify_cfg::SimplifyCfg);
908905
passes.push_pass(box mir::transform::remove_dead_blocks::RemoveDeadBlocks);

src/librustc_mir/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ rustc_back = { path = "../librustc_back" }
1616
rustc_const_eval = { path = "../librustc_const_eval" }
1717
rustc_const_math = { path = "../librustc_const_math" }
1818
rustc_data_structures = { path = "../librustc_data_structures" }
19+
rustc_bitflags = { path = "../librustc_bitflags" }
1920
syntax = { path = "../libsyntax" }

src/librustc_mir/build/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub struct ScopeAuxiliary {
8484
pub postdoms: Vec<Location>,
8585
}
8686

87-
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
87+
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
8888
pub struct Location {
8989
/// the location is within this block
9090
pub block: BasicBlock,

0 commit comments

Comments
 (0)