mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
2f722e6379
* up to ash * add more expressions * fix some return variable usage nonsense * bfloat print working * basic-type working * type working, fix decompiler on all files * clang format
39 lines
902 B
C++
39 lines
902 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <memory>
|
|
|
|
// for RegSet:
|
|
#include "decompiler/analysis/reg_usage.h"
|
|
|
|
namespace decompiler {
|
|
class LinkedObjectFile;
|
|
class Function;
|
|
|
|
struct BasicBlock {
|
|
int start_word;
|
|
int end_word;
|
|
|
|
// [start, end)
|
|
int start_basic_op = -1;
|
|
int end_basic_op = -1;
|
|
int basic_op_size() const { return end_basic_op - start_basic_op; }
|
|
|
|
std::string label_name;
|
|
|
|
std::vector<int> pred;
|
|
int succ_ft = -1;
|
|
int succ_branch = -1;
|
|
|
|
BasicBlock(int _start_word, int _end_word) : start_word(_start_word), end_word(_end_word) {}
|
|
};
|
|
|
|
struct BlockTopologicalSort {
|
|
std::vector<int> vist_order;
|
|
std::unordered_set<int> unreachable;
|
|
};
|
|
|
|
std::vector<BasicBlock> find_blocks_in_function(const LinkedObjectFile& file,
|
|
int seg,
|
|
const Function& func);
|
|
} // namespace decompiler
|