mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
use the type name as the pass name
This commit is contained in:
parent
065a264976
commit
f5b1ba6e90
@ -28,6 +28,7 @@
|
||||
#![feature(box_syntax)]
|
||||
#![feature(collections)]
|
||||
#![feature(const_fn)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(enumset)]
|
||||
#![feature(iter_arith)]
|
||||
#![feature(libc)]
|
||||
|
@ -76,7 +76,9 @@ pub trait Pass {
|
||||
fn dep_node(&self, def_id: DefId) -> DepNode<DefId> {
|
||||
DepNode::MirPass(def_id)
|
||||
}
|
||||
fn name(&self) -> &str;
|
||||
fn name(&self) -> &str {
|
||||
unsafe { ::std::intrinsics::type_name::<Self>() }
|
||||
}
|
||||
fn disambiguator<'a>(&'a self) -> Option<Box<fmt::Display+'a>> { None }
|
||||
}
|
||||
|
||||
|
@ -69,9 +69,7 @@ impl<'tcx> MirPass<'tcx> for ElaborateDrops {
|
||||
}
|
||||
}
|
||||
|
||||
impl Pass for ElaborateDrops {
|
||||
fn name(&self) -> &str { "elaborate-drops" }
|
||||
}
|
||||
impl Pass for ElaborateDrops {}
|
||||
|
||||
struct InitializationData {
|
||||
live: IdxSetBuf<MovePathIndex>,
|
||||
|
@ -1059,7 +1059,7 @@ pub fn phase_4_translate_to_llvm<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
passes.push_pass(box mir::transform::simplify_cfg::SimplifyCfg::new("elaborate-drops"));
|
||||
|
||||
passes.push_pass(box mir::transform::add_call_guards::AddCallGuards);
|
||||
passes.push_pass(box mir::transform::dump_mir::Marker("pre-trans"));
|
||||
passes.push_pass(box mir::transform::dump_mir::Marker("PreTrans"));
|
||||
|
||||
passes.run_passes(tcx, &mut mir_map);
|
||||
});
|
||||
|
@ -82,6 +82,4 @@ impl<'tcx> MirPass<'tcx> for AddCallGuards {
|
||||
}
|
||||
}
|
||||
|
||||
impl Pass for AddCallGuards {
|
||||
fn name(&self) -> &str { "add-call-guards" }
|
||||
}
|
||||
impl Pass for AddCallGuards {}
|
||||
|
@ -70,6 +70,4 @@ impl<'tcx> MirPassHook<'tcx> for DumpMir {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'b> Pass for DumpMir {
|
||||
fn name(&self) -> &str { "dump-mir" }
|
||||
}
|
||||
impl<'b> Pass for DumpMir {}
|
||||
|
@ -43,9 +43,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for EraseRegionsVisitor<'a, 'tcx> {
|
||||
|
||||
pub struct EraseRegions;
|
||||
|
||||
impl Pass for EraseRegions {
|
||||
fn name(&self) -> &str { "erase-regions" }
|
||||
}
|
||||
impl Pass for EraseRegions {}
|
||||
|
||||
impl<'tcx> MirPass<'tcx> for EraseRegions {
|
||||
fn run_pass<'a>(&mut self, tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
|
@ -50,6 +50,4 @@ impl<'tcx> MirPass<'tcx> for NoLandingPads {
|
||||
}
|
||||
}
|
||||
|
||||
impl Pass for NoLandingPads {
|
||||
fn name(&self) -> &str { "no-landing-pads" }
|
||||
}
|
||||
impl Pass for NoLandingPads {}
|
||||
|
@ -906,9 +906,7 @@ fn qualify_const_item_cached<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
|
||||
pub struct QualifyAndPromoteConstants;
|
||||
|
||||
impl Pass for QualifyAndPromoteConstants {
|
||||
fn name(&self) -> &str { "qualify-consts" }
|
||||
}
|
||||
impl Pass for QualifyAndPromoteConstants {}
|
||||
|
||||
impl<'tcx> MirMapPass<'tcx> for QualifyAndPromoteConstants {
|
||||
fn run_pass<'a>(&mut self,
|
||||
|
@ -57,7 +57,6 @@ impl<'l, 'tcx> MirPass<'tcx> for SimplifyBranches<'l> {
|
||||
}
|
||||
|
||||
impl<'l> Pass for SimplifyBranches<'l> {
|
||||
fn name(&self) -> &str { "simplify-branches" }
|
||||
fn disambiguator<'a>(&'a self) -> Option<Box<fmt::Display+'a>> {
|
||||
Some(Box::new(self.label))
|
||||
}
|
||||
|
@ -59,7 +59,6 @@ impl<'l, 'tcx> MirPass<'tcx> for SimplifyCfg<'l> {
|
||||
}
|
||||
|
||||
impl<'l> Pass for SimplifyCfg<'l> {
|
||||
fn name(&self) -> &str { "simplify-cfg" }
|
||||
fn disambiguator<'a>(&'a self) -> Option<Box<fmt::Display+'a>> {
|
||||
Some(Box::new(self.label))
|
||||
}
|
||||
|
@ -717,6 +717,4 @@ impl Pass for TypeckMir {
|
||||
fn dep_node(&self, def_id: DefId) -> DepNode<DefId> {
|
||||
DepNode::MirTypeck(def_id)
|
||||
}
|
||||
|
||||
fn name(&self) -> &str { "typeck-mir" }
|
||||
}
|
||||
|
@ -28,9 +28,7 @@ use rustc_plugin::Registry;
|
||||
|
||||
struct Pass;
|
||||
|
||||
impl transform::Pass for Pass {
|
||||
fn name(&self) -> &str { "dummy-mir-pass" }
|
||||
}
|
||||
impl transform::Pass for Pass {}
|
||||
|
||||
impl<'tcx> MirPass<'tcx> for Pass {
|
||||
fn run_pass<'a>(&mut self, _: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
|
Loading…
Reference in New Issue
Block a user