Use EntityRef::from_u32 to reduce casting.

This commit is contained in:
Dan Gohman
2018-12-11 12:25:06 -08:00
parent a55c933f19
commit bc18085ad1
6 changed files with 27 additions and 34 deletions

View File

@@ -13,7 +13,6 @@
use dbg::DisplayList;
use dominator_tree::DominatorTreePreorder;
use entity::EntityRef;
use entity::{EntityList, ListPool};
use entity::{Keys, PrimaryMap, SecondaryMap};
use ir::{Function, Value};
@@ -258,7 +257,7 @@ impl UFEntry {
/// Decode a table entry.
fn decode(x: i32) -> Self {
if x < 0 {
UFEntry::Link(Value::new((!x) as usize))
UFEntry::Link(Value::from_u32((!x) as u32))
} else {
UFEntry::Rank(x as u32)
}