Commit f3a7b9af authored by qinsoon's avatar qinsoon

remove warnings

parent aaff5ded
Pipeline #217 failed with stage
in 24 minutes and 2 seconds
......@@ -9,6 +9,7 @@ use std::fmt;
use std::sync::RwLock;
#[derive(Debug)]
// this implements RustcEncodable, RustcDecodable, Clone and Display
pub struct Instruction {
pub hdr: MuEntityHeader,
pub value : Option<Vec<P<Value>>>,
......@@ -83,6 +84,7 @@ impl fmt::Display for Instruction {
}
}
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, RustcEncodable, RustcDecodable)]
pub enum Instruction_ {
// non-terminal instruction
......
......@@ -225,7 +225,7 @@ impl MuFunctionVersion {
let f_content = self.content.as_ref().unwrap();
for (blk_id, block) in f_content.blocks.iter() {
for (_, block) in f_content.blocks.iter() {
let block_content = block.content.as_ref().unwrap();
for inst in block_content.body.iter() {
......@@ -266,14 +266,12 @@ impl MuFunctionVersion {
pub fn has_throw(&self) -> bool {
let f_content = self.content.as_ref().unwrap();
for (blk_id, block) in f_content.blocks.iter() {
for (_, block) in f_content.blocks.iter() {
let block_content = block.content.as_ref().unwrap();
for inst in block_content.body.iter() {
match inst.v {
TreeNode_::Instruction(ref inst) => {
let ops = inst.ops.read().unwrap();
match inst.v {
Instruction_::Throw(_) => {return true;}
_ => {
......
......@@ -4,6 +4,7 @@ use inst::*;
use types::MuType_::*;
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)]
#[allow(non_camel_case_types)]
pub enum OpCode {
// SSA
RegI64,
......
......@@ -814,7 +814,7 @@ impl ASMCodeGen {
fn add_asm_call(&mut self, code: String) {
// a call instruction will use all the argument registers
// do not need
let mut uses : HashMap<MuID, Vec<ASMLocation>> = HashMap::new();
let uses : HashMap<MuID, Vec<ASMLocation>> = HashMap::new();
// for reg in x86_64::ARGUMENT_GPRs.iter() {
// uses.insert(reg.id(), vec![]);
// }
......
......@@ -108,7 +108,7 @@ impl Inlining {
let mut new_blocks : Vec<Block> = vec![];
for (blk_id, mut block) in f_content.blocks.drain() {
for (_, block) in f_content.blocks.drain() {
// clone curent block, and clear its instructions
let mut cur_block = block.clone();
cur_block.content.as_mut().unwrap().body.clear();
......
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