mirror of
https://github.com/open-goal/jak-project
synced 2026-08-07 10:16:45 -04:00
remove old ir1 code (#1287)
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <numeric>
|
||||
#include "decompiler/IR/IR.h"
|
||||
#include "third-party/fmt/core.h"
|
||||
#include "LinkedObjectFile.h"
|
||||
#include "decompiler/Disasm/InstructionDecode.h"
|
||||
@@ -583,23 +582,6 @@ std::string LinkedObjectFile::print_function_disassembly(Function& func,
|
||||
result += " ;;";
|
||||
auto& word = words_by_seg[seg].at(func.start_word + i);
|
||||
append_word_to_string(result, word);
|
||||
} else {
|
||||
// print basic op stuff
|
||||
if (func.has_basic_ops() && func.instr_starts_basic_op(i)) {
|
||||
if (line.length() < 30) {
|
||||
line.append(30 - line.length(), ' ');
|
||||
}
|
||||
line += ";; " + func.get_basic_op_at_instr(i)->print(*this);
|
||||
for (int iidx = 0; iidx < instr.n_src; iidx++) {
|
||||
if (instr.get_src(iidx).is_label()) {
|
||||
auto lab = labels.at(instr.get_src(iidx).get_label());
|
||||
if (is_string(lab.target_segment, lab.offset)) {
|
||||
line += " " + get_goal_string(lab.target_segment, lab.offset / 4 - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
result += line + "\n";
|
||||
}
|
||||
|
||||
if (in_delay_slot) {
|
||||
@@ -659,11 +641,6 @@ std::string LinkedObjectFile::print_function_disassembly(Function& func,
|
||||
*/
|
||||
}
|
||||
|
||||
if (func.ir) {
|
||||
result += ";; ir\n";
|
||||
result += func.ir->print(*this);
|
||||
}
|
||||
|
||||
result += "\n\n\n";
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#include "common/util/Timer.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
#include "decompiler/Function/BasicBlocks.h"
|
||||
#include "decompiler/IR/BasicOpBuilder.h"
|
||||
#include "decompiler/Function/TypeInspector.h"
|
||||
#include "common/log/log.h"
|
||||
#include "common/util/json_util.h"
|
||||
|
||||
@@ -134,7 +132,7 @@ ObjectFileDB::ObjectFileDB(const std::vector<std::string>& _dgos,
|
||||
try {
|
||||
get_objs_from_dgo(dgo, config);
|
||||
} catch (std::runtime_error& e) {
|
||||
lg::warn("Error when reading DGOs: {}", e.what());
|
||||
lg::warn("Error when reading DGOs: {} on {}", e.what(), dgo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -735,8 +733,6 @@ void ObjectFileDB::analyze_functions_ir1(const Config& config) {
|
||||
|
||||
int total_trivial_cfg_functions = 0;
|
||||
int total_named_functions = 0;
|
||||
int total_basic_ops = 0;
|
||||
int total_failed_basic_ops = 0;
|
||||
|
||||
int asm_funcs = 0;
|
||||
|
||||
@@ -774,24 +770,8 @@ void ObjectFileDB::analyze_functions_ir1(const Config& config) {
|
||||
if (label_id != -1) {
|
||||
block.label_name = data.linked_data.get_label_name(label_id);
|
||||
}
|
||||
|
||||
block.start_basic_op = func.basic_ops.size();
|
||||
add_basic_ops_to_block(&func, block, &data.linked_data);
|
||||
block.end_basic_op = func.basic_ops.size();
|
||||
}
|
||||
}
|
||||
total_basic_ops += func.get_basic_op_count();
|
||||
total_failed_basic_ops += func.get_failed_basic_op_count();
|
||||
|
||||
// if we got an inspect method, inspect it.
|
||||
if (func.is_inspect_method) {
|
||||
auto result = inspect_inspect_method(
|
||||
func, func.method_of_type, dts, data.linked_data,
|
||||
config.hacks.types_with_bad_inspect_methods.find(func.method_of_type) !=
|
||||
config.hacks.types_with_bad_inspect_methods.end());
|
||||
all_type_defs += ";; " + data.to_unique_name() + "\n";
|
||||
all_type_defs += result.print_as_deftype() + "\n";
|
||||
}
|
||||
} else {
|
||||
asm_funcs++;
|
||||
}
|
||||
@@ -802,10 +782,6 @@ void ObjectFileDB::analyze_functions_ir1(const Config& config) {
|
||||
lg::info("Named {}/{} functions ({:.3f}%)", total_named_functions, total_functions,
|
||||
100.f * float(total_named_functions) / float(total_functions));
|
||||
lg::info("Excluding {} asm functions", asm_funcs);
|
||||
lg::info("Found {} basic blocks in {:.3f} ms", total_basic_blocks, timer.getMs());
|
||||
int successful_basic_ops = total_basic_ops - total_failed_basic_ops;
|
||||
lg::info(" {}/{} basic ops converted successfully ({:.3f}%)", successful_basic_ops,
|
||||
total_basic_ops, 100.f * float(successful_basic_ops) / float(total_basic_ops));
|
||||
}
|
||||
|
||||
void ObjectFileDB::dump_raw_objects(const std::string& output_dir) {
|
||||
|
||||
@@ -103,7 +103,6 @@ class ObjectFileDB {
|
||||
|
||||
ObjectFileData& lookup_record(const ObjectFileRecord& rec);
|
||||
DecompilerTypeSystem dts;
|
||||
std::string all_type_defs;
|
||||
|
||||
bool lookup_function_type(const FunctionName& name,
|
||||
const std::string& obj_name,
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "common/log/log.h"
|
||||
#include "common/util/Timer.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
#include "decompiler/Function/TypeInspector.h"
|
||||
#include "decompiler/analysis/type_analysis.h"
|
||||
#include "decompiler/analysis/reg_usage.h"
|
||||
#include "decompiler/analysis/insert_lets.h"
|
||||
|
||||
Reference in New Issue
Block a user