Skip to content

Commit b3342b4

Browse files
committed
liveness: Remove unused clean_exit_var
1 parent 3f13d97 commit b3342b4

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/librustc_passes/liveness.rs

+1-14
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@
8585
//! the function, whether it be by explicit return, panic, or other means.
8686
//!
8787
//! - `fallthrough_ln`: a live node that represents a fallthrough
88-
//!
89-
//! - `clean_exit_var`: a synthetic variable that is only 'read' from the
90-
//! fallthrough node. It is only live if the function could converge
91-
//! via means other than an explicit `return` expression. That is, it is
92-
//! only dead if the end of the function's block can never be reached.
93-
//! It is the responsibility of typeck to ensure that there are no
94-
//! `return` expressions in a function declared as diverging.
9588
9689
use self::LiveNodeKind::*;
9790
use self::VarKind::*;
@@ -253,7 +246,6 @@ struct LocalInfo {
253246
enum VarKind {
254247
Param(HirId, Symbol),
255248
Local(LocalInfo),
256-
CleanExit,
257249
}
258250

259251
struct IrMaps<'tcx> {
@@ -309,7 +301,6 @@ impl IrMaps<'tcx> {
309301
Local(LocalInfo { id: node_id, .. }) | Param(node_id, _) => {
310302
self.variable_map.insert(node_id, v);
311303
}
312-
CleanExit => {}
313304
}
314305

315306
debug!("{:?} is {:?}", v, vk);
@@ -329,14 +320,13 @@ impl IrMaps<'tcx> {
329320
fn variable_name(&self, var: Variable) -> String {
330321
match self.var_kinds[var.get()] {
331322
Local(LocalInfo { name, .. }) | Param(_, name) => name.to_string(),
332-
CleanExit => "<clean-exit>".to_owned(),
333323
}
334324
}
335325

336326
fn variable_is_shorthand(&self, var: Variable) -> bool {
337327
match self.var_kinds[var.get()] {
338328
Local(LocalInfo { is_shorthand, .. }) => is_shorthand,
339-
Param(..) | CleanExit => false,
329+
Param(..) => false,
340330
}
341331
}
342332

@@ -649,7 +639,6 @@ impl RWUTable {
649639
struct Specials {
650640
exit_ln: LiveNode,
651641
fallthrough_ln: LiveNode,
652-
clean_exit_var: Variable,
653642
}
654643

655644
const ACC_READ: u32 = 1;
@@ -680,7 +669,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
680669
let specials = Specials {
681670
exit_ln: ir.add_live_node(ExitNode),
682671
fallthrough_ln: ir.add_live_node(ExitNode),
683-
clean_exit_var: ir.add_variable(CleanExit),
684672
};
685673

686674
let tables = ir.tcx.typeck_tables_of(def_id);
@@ -913,7 +901,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
913901
// explicitly return:
914902
let s = self.s;
915903
self.init_from_succ(s.fallthrough_ln, s.exit_ln);
916-
self.acc(s.fallthrough_ln, s.clean_exit_var, ACC_READ);
917904

918905
let entry_ln = self.propagate_through_expr(body, s.fallthrough_ln);
919906

0 commit comments

Comments
 (0)