mirror of
https://github.com/open-goal/jak-project.git
synced 2024-11-27 08:20:47 +00:00
f9d8fcd6e4
* 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
33 lines
652 B
C++
33 lines
652 B
C++
#pragma once
|
|
|
|
#include <unordered_set>
|
|
#include <vector>
|
|
|
|
#include "decompiler/Disasm/Register.h"
|
|
|
|
namespace decompiler {
|
|
|
|
class Function;
|
|
|
|
using RegSet = std::unordered_set<Register, Register::hash>;
|
|
|
|
struct RegUsageInfo {
|
|
struct PerBlock {
|
|
RegSet use, defs, input, output;
|
|
};
|
|
|
|
struct PerOp {
|
|
RegSet live, dead, consumes, written_and_unused, live_in;
|
|
};
|
|
|
|
int block_count() const { return int(block.size()); }
|
|
|
|
std::vector<PerBlock> block;
|
|
std::vector<PerOp> op;
|
|
|
|
RegUsageInfo() = default;
|
|
RegUsageInfo(int n_blocks, int n_ops);
|
|
};
|
|
|
|
RegUsageInfo analyze_ir2_register_usage(const Function& function);
|
|
} // namespace decompiler
|