Don't pass Copy objects by reference.

This commit is contained in:
Dan Gohman
2018-08-28 14:34:11 -07:00
parent 9ada394d11
commit bdd1949b34
2 changed files with 5 additions and 5 deletions

View File

@@ -206,7 +206,7 @@ impl<'a> Context<'a> {
}
// Resolve a reference to a table.
fn check_table(&self, table: Table, loc: &Location) -> ParseResult<()> {
fn check_table(&self, table: Table, loc: Location) -> ParseResult<()> {
if !self.map.contains_table(table) {
err!(loc, "undefined table {}", table)
} else {
@@ -2249,7 +2249,7 @@ impl<'a> Parser<'a> {
}
InstructionFormat::TableAddr => {
let table = self.match_table("expected table identifier")?;
ctx.check_table(table, &self.loc)?;
ctx.check_table(table, self.loc)?;
self.match_token(Token::Comma, "expected ',' between operands")?;
let arg = self.match_value("expected SSA value table address")?;
self.match_token(Token::Comma, "expected ',' between operands")?;

View File

@@ -706,9 +706,9 @@ pub fn populate_inst(func: &Function, ebb: Ebb) -> Vec<SerInst> {
}
/// Translating Ebb parameters into serializable parameters.
pub fn populate_params(func: &Function, ebb: &Ebb) -> Vec<String> {
pub fn populate_params(func: &Function, ebb: Ebb) -> Vec<String> {
let mut ser_vec: Vec<String> = Vec::new();
let parameters = func.dfg.ebb_params(*ebb);
let parameters = func.dfg.ebb_params(ebb);
for param in parameters {
ser_vec.push(param.to_string());
}
@@ -727,7 +727,7 @@ pub fn populate_ebbs(func: &Function) -> Vec<SerEbb> {
let mut ebb_vec: Vec<SerEbb> = Vec::new();
for ebb in func.layout.ebbs() {
let mut ser_ebb: SerEbb = SerEbb::new(ebb.to_string());
ser_ebb.params = populate_params(&func, &ebb);
ser_ebb.params = populate_params(&func, ebb);
ser_ebb.insts = populate_inst(&func, ebb);
ebb_vec.push(ser_ebb);
}