Commit a5014bc4 authored by qinsoon's avatar qinsoon

fixed a few warnings

parent b984d3c1
use ast::ir::MuID; use ast::ir::MuID;
use compiler::backend::reg_alloc::liveness::InterferenceGraph; use compiler::backend::reg_alloc::liveness::InterferenceGraph;
use compiler::backend::reg_alloc::liveness::{Node, Move}; use compiler::backend::reg_alloc::liveness::{Node, Move};
use vm::machine_code::CompiledFunction;
use compiler::backend; use compiler::backend;
use utils::vec_utils; use utils::vec_utils;
...@@ -85,22 +84,19 @@ impl GraphColoring { ...@@ -85,22 +84,19 @@ impl GraphColoring {
fn init (&mut self) { fn init (&mut self) {
trace!("Initializing coloring allocator..."); trace!("Initializing coloring allocator...");
// for all machine registers // precolor for all machine registers
for reg in backend::all_regs().iter() { for reg in backend::all_regs().iter() {
let reg_id = reg.extract_ssa_id().unwrap(); let reg_id = reg.extract_ssa_id().unwrap();
let node = self.ig.get_node(reg_id); let node = self.ig.get_node(reg_id);
self.precolored.insert(node); self.precolored.insert(node);
} }
// put usable registers as available colors
for reg in backend::all_usable_regs().iter() { for reg in backend::all_usable_regs().iter() {
let reg_id = reg.extract_ssa_id().unwrap(); let reg_id = reg.extract_ssa_id().unwrap();
let node = self.ig.get_node(reg_id);
{
let group = backend::pick_group_for_reg(reg_id); let group = backend::pick_group_for_reg(reg_id);
self.colors.get_mut(&group).unwrap().insert(reg_id); self.colors.get_mut(&group).unwrap().insert(reg_id);
} }
}
for node in self.ig.nodes() { for node in self.ig.nodes() {
if !self.ig.is_colored(node) { if !self.ig.is_colored(node) {
......
...@@ -64,7 +64,6 @@ impl<K: Hash + Eq + Clone> Clone for LinkedHashSet<K> { ...@@ -64,7 +64,6 @@ impl<K: Hash + Eq + Clone> Clone for LinkedHashSet<K> {
} }
use std::fmt; use std::fmt;
use std::fmt::DebugSet;
impl<A: fmt::Debug + Hash + Eq, S: BuildHasher> fmt::Debug for LinkedHashSet<A, S> { impl<A: fmt::Debug + Hash + Eq, S: BuildHasher> fmt::Debug for LinkedHashSet<A, S> {
/// Returns a string that lists the key-value pairs in insertion order. /// Returns a string that lists the key-value pairs in insertion order.
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment