#ifndef PS2RECOMP_CONTROL_FLOW_ANALYZER_H #define PS2RECOMP_CONTROL_FLOW_ANALYZER_H #include #include #include #include namespace ps2recomp { struct Function; struct Instruction; struct Section; class RecompilerReporter; struct ControlFlowAnalysisResult { std::unordered_set entryPoints; std::unordered_set externalEntryPoints; std::unordered_set resumeEntryPoints; std::unordered_set indirectFallbackEntryPoints; std::unordered_map> jumpTableTargets; }; class ControlFlowAnalyzer { public: ControlFlowAnalyzer(const std::vector
§ions, const std::unordered_map> &configuredJumpTableTargetsByAddress, RecompilerReporter *reporter); ControlFlowAnalysisResult analyze(const Function &function, const std::vector &instructions, const std::vector *allFunctions = nullptr) const; private: const std::vector
&m_sections; const std::unordered_map> &m_configJumpTableTargetsByAddress; RecompilerReporter *m_reporter = nullptr; }; } #endif // PS2RECOMP_CONTROL_FLOW_ANALYZER_H