Switch dev backend from unimplemented! to todo!

This commit is contained in:
Brendan Hansknecht 2021-12-09 10:39:43 -08:00
parent 1ce648ac27
commit 7abbf3a043
5 changed files with 83 additions and 116 deletions

View file

@ -572,7 +572,7 @@ impl<
Layout::Builtin(Builtin::Str) => {
if CC::returns_via_arg_pointer(ret_layout) {
// This will happen on windows, return via pointer here.
unimplemented!("FnCall: Returning strings via pointer not yet implemented");
todo!("FnCall: Returning strings via pointer");
} else {
let offset = self.claim_stack_size(16);
self.symbol_storage_map.insert(
@ -590,10 +590,7 @@ impl<
Layout::Struct([]) => {
// Nothing needs to be done to load a returned empty struct.
}
x => unimplemented!(
"FnCall: receiving return type, {:?}, is not yet implemented",
x
),
x => todo!("FnCall: receiving return type, {:?}", x),
}
}
@ -637,10 +634,7 @@ impl<
self.buf[jne_location + i] = *byte;
}
} else {
unimplemented!(
"Switch: branch info, {:?}, is not yet implemented",
branch_info
);
todo!("Switch: branch info, {:?}", branch_info);
}
}
let (branch_info, stmt) = default_branch;
@ -658,10 +652,7 @@ impl<
);
}
} else {
unimplemented!(
"Switch: branch info, {:?}, is not yet implemented",
branch_info
);
todo!("Switch: branch info, {:?}", branch_info);
}
}
@ -803,7 +794,7 @@ impl<
let src_reg = self.load_to_float_reg(src);
ASM::abs_freg64_freg64(&mut self.buf, &mut self.relocs, dst_reg, src_reg);
}
x => unimplemented!("NumAbs: layout, {:?}, not implemented yet", x),
x => todo!("NumAbs: layout, {:?}", x),
}
}
@ -821,7 +812,7 @@ impl<
let src2_reg = self.load_to_float_reg(src2);
ASM::add_freg64_freg64_freg64(&mut self.buf, dst_reg, src1_reg, src2_reg);
}
x => unimplemented!("NumAdd: layout, {:?}, not implemented yet", x),
x => todo!("NumAdd: layout, {:?}", x),
}
}
@ -833,7 +824,7 @@ impl<
let src2_reg = self.load_to_general_reg(src2);
ASM::imul_reg64_reg64_reg64(&mut self.buf, dst_reg, src1_reg, src2_reg);
}
x => unimplemented!("NumMul: layout, {:?}, not implemented yet", x),
x => todo!("NumMul: layout, {:?}", x),
}
}
@ -844,7 +835,7 @@ impl<
let src_reg = self.load_to_general_reg(src);
ASM::neg_reg64_reg64(&mut self.buf, dst_reg, src_reg);
}
x => unimplemented!("NumNeg: layout, {:?}, not implemented yet", x),
x => todo!("NumNeg: layout, {:?}", x),
}
}
@ -856,7 +847,7 @@ impl<
let src2_reg = self.load_to_general_reg(src2);
ASM::sub_reg64_reg64_reg64(&mut self.buf, dst_reg, src1_reg, src2_reg);
}
x => unimplemented!("NumSub: layout, {:?}, not implemented yet", x),
x => todo!("NumSub: layout, {:?}", x),
}
}
@ -868,7 +859,7 @@ impl<
let src2_reg = self.load_to_general_reg(src2);
ASM::eq_reg64_reg64_reg64(&mut self.buf, dst_reg, src1_reg, src2_reg);
}
x => unimplemented!("NumEq: layout, {:?}, not implemented yet", x),
x => todo!("NumEq: layout, {:?}", x),
}
}
@ -880,7 +871,7 @@ impl<
let src2_reg = self.load_to_general_reg(src2);
ASM::neq_reg64_reg64_reg64(&mut self.buf, dst_reg, src1_reg, src2_reg);
}
x => unimplemented!("NumNeq: layout, {:?}, not implemented yet", x),
x => todo!("NumNeq: layout, {:?}", x),
}
}
@ -898,7 +889,7 @@ impl<
let src2_reg = self.load_to_general_reg(src2);
ASM::lt_reg64_reg64_reg64(&mut self.buf, dst_reg, src1_reg, src2_reg);
}
x => unimplemented!("NumLt: layout, {:?}, not implemented yet", x),
x => todo!("NumLt: layout, {:?}", x),
}
}
@ -953,11 +944,7 @@ impl<
let src_reg = self.load_to_float_reg(src);
ASM::mov_freg64_freg64(&mut self.buf, dst_reg, src_reg);
}
(a, r) => unimplemented!(
"NumToFloat: layout, arg {:?}, ret {:?}, not implemented yet",
a,
r
),
(a, r) => todo!("NumToFloat: layout, arg {:?}, ret {:?}", a, r),
}
}
@ -975,7 +962,7 @@ impl<
let src2_reg = self.load_to_general_reg(src2);
ASM::gte_reg64_reg64_reg64(&mut self.buf, dst_reg, src1_reg, src2_reg);
}
x => unimplemented!("NumGte: layout, {:?}, not implemented yet", x),
x => todo!("NumGte: layout, {:?}", x),
}
}
@ -1115,7 +1102,7 @@ impl<
ASM::mov_reg64_imm64(&mut self.buf, reg, num);
ASM::mov_base32_reg64(&mut self.buf, offset + 8, reg);
}
x => unimplemented!("loading literal, {:?}, is not yet implemented", x),
x => todo!("loading literal, {:?}", x),
}
}
@ -1236,7 +1223,7 @@ impl<
Layout::Builtin(Builtin::Str) => {
if self.symbol_storage_map.contains_key(&Symbol::RET_POINTER) {
// This will happen on windows, return via pointer here.
unimplemented!("Returning strings via pointer not yet implemented");
todo!("Returning strings via pointer");
} else {
ASM::mov_reg64_base32(&mut self.buf, CC::GENERAL_RETURN_REGS[0], *offset);
ASM::mov_reg64_base32(
@ -1259,12 +1246,9 @@ impl<
CC::return_struct(&mut self.buf, offset, size, field_layouts, ret_reg);
}
}
x => unimplemented!(
"returning symbol with layout, {:?}, is not yet implemented",
x
),
x => todo!("returning symbol with layout, {:?}", x),
},
Some(x) => unimplemented!("returning symbol storage, {:?}, is not yet implemented", x),
Some(x) => todo!("returning symbol storage, {:?}", x),
None if layout == &Layout::Struct(&[]) => {
// Empty struct is not defined and does nothing.
}
@ -1596,10 +1580,7 @@ impl<
internal_error!("unknown struct: {:?}", sym);
}
}
x => unimplemented!(
"copying data to the stack with layout, {:?}, not implemented yet",
x
),
x => todo!("copying data to the stack with layout, {:?}", x),
}
}