mirror of
https://github.com/open-goal/jak-project
synced 2026-08-08 10:34:30 -04:00
[decomp] add mips2c converter (#842)
* mips 2 c basic version, not yet tested * calling works without crashing, but the function doesn't * it works * add test * cleanup and actually add the test * dont use mips2c by default for font * clean up formatting
This commit is contained in:
@@ -78,7 +78,7 @@ void Function::analyze_prologue(const LinkedObjectFile& file) {
|
||||
lg::warn(
|
||||
"Function {} was flagged as asm due to this instruction: {}. Consider flagging as asm "
|
||||
"in config!",
|
||||
guessed_name.to_string(), instr.to_string(file.labels));
|
||||
name(), instr.to_string(file.labels));
|
||||
warnings.general_warning("Flagged as asm because of {}", instr.to_string(file.labels));
|
||||
suspected_asm = true;
|
||||
return;
|
||||
@@ -103,7 +103,7 @@ void Function::analyze_prologue(const LinkedObjectFile& file) {
|
||||
lg::warn(
|
||||
"Function {} was flagged as asm due to this instruction: {}. Consider flagging as asm "
|
||||
"in config!",
|
||||
guessed_name.to_string(), instr.to_string(file.labels));
|
||||
name(), instr.to_string(file.labels));
|
||||
warnings.general_warning("Flagged as asm because of {}", instr.to_string(file.labels));
|
||||
suspected_asm = true;
|
||||
return;
|
||||
@@ -158,7 +158,7 @@ void Function::analyze_prologue(const LinkedObjectFile& file) {
|
||||
if (this_reg != get_expected_gpr_backup(i, n_gpr_backups)) {
|
||||
suspected_asm = true;
|
||||
lg::warn("Function {} stores on the stack in a strange way ({}), flagging as asm!",
|
||||
instructions.at(idx + i).to_string(file.labels), guessed_name.to_string());
|
||||
instructions.at(idx + i).to_string(file.labels), name());
|
||||
warnings.general_warning("Flagged as asm due to strange stack store: {}",
|
||||
instructions.at(idx + i).to_string(file.labels));
|
||||
return;
|
||||
@@ -187,7 +187,7 @@ void Function::analyze_prologue(const LinkedObjectFile& file) {
|
||||
if (this_reg != get_expected_fpr_backup(i, n_fpr_backups)) {
|
||||
suspected_asm = true;
|
||||
lg::warn("Function {} stores on the stack in a strange way ({}), flagging as asm!",
|
||||
instructions.at(idx + i).to_string(file.labels), guessed_name.to_string());
|
||||
instructions.at(idx + i).to_string(file.labels), name());
|
||||
warnings.general_warning("Flagged as asm due to strange stack store: {}",
|
||||
instructions.at(idx + i).to_string(file.labels));
|
||||
return;
|
||||
@@ -378,8 +378,7 @@ void Function::check_epilogue(const LinkedObjectFile& file) {
|
||||
idx--;
|
||||
assert(is_jr_ra(instructions.at(idx)));
|
||||
idx--;
|
||||
lg::warn("Function {} has a double return and is being flagged as asm.",
|
||||
guessed_name.to_string());
|
||||
lg::warn("Function {} has a double return and is being flagged as asm.", name());
|
||||
warnings.general_warning("Flagged as asm due to double return");
|
||||
}
|
||||
// delay slot should be daddiu sp, sp, offset
|
||||
@@ -773,4 +772,8 @@ BlockTopologicalSort Function::bb_topo_sort() {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string Function::name() const {
|
||||
return guessed_name.to_string();
|
||||
}
|
||||
} // namespace decompiler
|
||||
Reference in New Issue
Block a user