adding regalloc, fixing needless semicolon insertion
This commit is contained in:
parent
454b0ffd1c
commit
e4da9cc927
|
@ -149,7 +149,7 @@ impl<'a> Formatter<'a> {
|
||||||
if let Some(expr) = list.get(i + 1)
|
if let Some(expr) = list.get(i + 1)
|
||||||
&& let Some(rest) = self.source.get(expr.posi() as usize..)
|
&& let Some(rest) = self.source.get(expr.posi() as usize..)
|
||||||
{
|
{
|
||||||
if insert_needed_semicolon(rest) {
|
if sep.is_empty() && insert_needed_semicolon(rest) {
|
||||||
f.write_str(";")?;
|
f.write_str(";")?;
|
||||||
}
|
}
|
||||||
if preserve_newlines(&self.source[..expr.posi() as usize]) > 1 {
|
if preserve_newlines(&self.source[..expr.posi() as usize]) > 1 {
|
||||||
|
|
|
@ -240,7 +240,10 @@ impl HbvmBackend {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(PLoc::Ref(r, ..)) = ret {
|
if node.ty.loc(tys) == Loc::Stack
|
||||||
|
&& let Some(PLoc::Reg(r, ..) | PLoc::WideReg(r, ..) | PLoc::Ref(r, ..)) =
|
||||||
|
ret
|
||||||
|
{
|
||||||
alloc_buf.push(atr(*node.inputs.last().unwrap()));
|
alloc_buf.push(atr(*node.inputs.last().unwrap()));
|
||||||
self.emit(instrs::cp(r, *alloc_buf.last().unwrap()))
|
self.emit(instrs::cp(r, *alloc_buf.last().unwrap()))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue