Files
jak-project/decompiler/Function/BasicBlocks.h
T
water111 27f0a7ca44 [Decompiler] Begin expression conversion, rearrange tests (#209)
* refactor tests and analysis passes

* identity test working

* combine test categories with only a few cases

* more fixes
2021-01-23 16:32:56 -05:00

43 lines
1.0 KiB
C++

#pragma once
#include <vector>
#include <memory>
#include "CfgVtx.h"
#include "decompiler/util/DecompilerTypeSystem.h"
#include "decompiler/util/TP_Type.h"
// for RegSet:
#include "decompiler/analysis/reg_usage.h"
namespace decompiler {
class LinkedObjectFile;
class Function;
struct BasicBlock {
int start_word;
int end_word;
TypeState init_types;
// [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