jak-project/decompiler/analysis/reg_usage.h
water111 f9d8fcd6e4
[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
2021-09-11 20:52:35 -04:00

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