Upgrade to Rust 1.17.
- Remove some uses of 'static in const and static globals that are no longer needed. - Use the new struct initialization shorthand.
This commit is contained in:
@@ -56,7 +56,7 @@ impl<'c, 'fc, 'fd> InsertBuilder<'c, 'fc, 'fd> {
|
||||
pub fn new(dfg: &'fd mut DataFlowGraph,
|
||||
pos: &'c mut Cursor<'fc>)
|
||||
-> InsertBuilder<'c, 'fc, 'fd> {
|
||||
InsertBuilder { dfg: dfg, pos: pos }
|
||||
InsertBuilder { dfg, pos }
|
||||
}
|
||||
|
||||
/// Reuse result values in `reuse`.
|
||||
@@ -72,7 +72,7 @@ impl<'c, 'fc, 'fd> InsertBuilder<'c, 'fc, 'fd> {
|
||||
InsertReuseBuilder {
|
||||
dfg: self.dfg,
|
||||
pos: self.pos,
|
||||
reuse: reuse,
|
||||
reuse,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,10 +154,7 @@ pub struct ReplaceBuilder<'f> {
|
||||
impl<'f> ReplaceBuilder<'f> {
|
||||
/// Create a `ReplaceBuilder` that will overwrite `inst`.
|
||||
pub fn new(dfg: &'f mut DataFlowGraph, inst: Inst) -> ReplaceBuilder {
|
||||
ReplaceBuilder {
|
||||
dfg: dfg,
|
||||
inst: inst,
|
||||
}
|
||||
ReplaceBuilder { dfg, inst }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -240,10 +240,7 @@ impl DataFlowGraph {
|
||||
self.value_type(dest),
|
||||
ty);
|
||||
|
||||
self.values[dest] = ValueData::Alias {
|
||||
ty: ty,
|
||||
original: original,
|
||||
};
|
||||
self.values[dest] = ValueData::Alias { ty, original };
|
||||
}
|
||||
|
||||
/// Create a new value alias.
|
||||
@@ -252,10 +249,7 @@ impl DataFlowGraph {
|
||||
pub fn make_value_alias(&mut self, src: Value) -> Value {
|
||||
let ty = self.value_type(src);
|
||||
|
||||
let data = ValueData::Alias {
|
||||
ty: ty,
|
||||
original: src,
|
||||
};
|
||||
let data = ValueData::Alias { ty, original: src };
|
||||
self.make_value(data)
|
||||
}
|
||||
}
|
||||
@@ -462,9 +456,9 @@ impl DataFlowGraph {
|
||||
assert!(num <= u16::MAX as usize, "Too many result values");
|
||||
let ty = self.value_type(res);
|
||||
self.values[res] = ValueData::Inst {
|
||||
ty: ty,
|
||||
ty,
|
||||
num: num as u16,
|
||||
inst: inst,
|
||||
inst,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -474,8 +468,8 @@ impl DataFlowGraph {
|
||||
let num = self.results[inst].push(res, &mut self.value_lists);
|
||||
assert!(num <= u16::MAX as usize, "Too many result values");
|
||||
self.make_value(ValueData::Inst {
|
||||
ty: ty,
|
||||
inst: inst,
|
||||
ty,
|
||||
inst,
|
||||
num: num as u16,
|
||||
})
|
||||
}
|
||||
@@ -594,9 +588,9 @@ impl DataFlowGraph {
|
||||
let num = self.ebbs[ebb].args.push(arg, &mut self.value_lists);
|
||||
assert!(num <= u16::MAX as usize, "Too many arguments to EBB");
|
||||
self.make_value(ValueData::Arg {
|
||||
ty: ty,
|
||||
ty,
|
||||
num: num as u16,
|
||||
ebb: ebb,
|
||||
ebb,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -611,9 +605,9 @@ impl DataFlowGraph {
|
||||
assert!(num <= u16::MAX as usize, "Too many arguments to EBB");
|
||||
let ty = self.value_type(arg);
|
||||
self.values[arg] = ValueData::Arg {
|
||||
ty: ty,
|
||||
ty,
|
||||
num: num as u16,
|
||||
ebb: ebb,
|
||||
ebb,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -635,8 +629,8 @@ impl DataFlowGraph {
|
||||
};
|
||||
let new_arg = self.make_value(ValueData::Arg {
|
||||
ty: new_type,
|
||||
num: num,
|
||||
ebb: ebb,
|
||||
num,
|
||||
ebb,
|
||||
});
|
||||
|
||||
self.ebbs[ebb].args.as_mut_slice(&mut self.value_lists)[num as usize] = new_arg;
|
||||
|
||||
@@ -138,7 +138,7 @@ impl ArgumentType {
|
||||
ArgumentType {
|
||||
value_type: vt,
|
||||
extension: ArgumentExtension::None,
|
||||
purpose: purpose,
|
||||
purpose,
|
||||
location: ArgumentLoc::Reg(regunit),
|
||||
}
|
||||
}
|
||||
@@ -239,7 +239,7 @@ pub enum ArgumentPurpose {
|
||||
}
|
||||
|
||||
/// Text format names of the `ArgumentPurpose` variants.
|
||||
static PURPOSE_NAMES: [&'static str; 5] = ["normal", "sret", "link", "fp", "csr"];
|
||||
static PURPOSE_NAMES: [&str; 5] = ["normal", "sret", "link", "fp", "csr"];
|
||||
|
||||
impl fmt::Display for ArgumentPurpose {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
|
||||
@@ -57,7 +57,7 @@ impl Function {
|
||||
/// Create a function with the given name and signature.
|
||||
pub fn with_name_signature(name: FunctionName, sig: Signature) -> Function {
|
||||
Function {
|
||||
name: name,
|
||||
name,
|
||||
signature: sig,
|
||||
stack_slots: EntityMap::new(),
|
||||
jump_tables: EntityMap::new(),
|
||||
|
||||
@@ -647,7 +647,7 @@ impl<'f> Cursor<'f> {
|
||||
/// The cursor holds a mutable reference to `layout` for its entire lifetime.
|
||||
pub fn new(layout: &'f mut Layout) -> Cursor {
|
||||
Cursor {
|
||||
layout: layout,
|
||||
layout,
|
||||
pos: CursorPosition::Nowhere,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ enum FlagBit {
|
||||
Aligned,
|
||||
}
|
||||
|
||||
const NAMES: [&'static str; 2] = ["notrap", "aligned"];
|
||||
const NAMES: [&str; 2] = ["notrap", "aligned"];
|
||||
|
||||
/// Flags for memory operations like load/store.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user