#pragma once #include #include #include #include #include #include class CRSPSystem; enum RspCodeType { RspCodeType_TASK, RspCodeType_SUBROUTINE, }; class RspCodeBlock; typedef std::unique_ptr RspCodeBlockPtr; typedef std::unordered_map RspCodeBlocks; typedef std::vector RSPInstructions; class RspCodeBlock { public: typedef std::set Addresses; RspCodeBlock(CRSPSystem & System, uint32_t StartAddress, RspCodeType type, uint32_t EndBlockAddress, RspCodeBlocks & Functions); const Addresses & GetBranchTargets() const; void * GetCompiledLocation() const; uint32_t GetEndBlockAddress() const; const Addresses & GetFunctionCalls() const; const RSPInstructions & GetInstructions() const; const RspCodeBlock * GetFunctionBlock(uint32_t Address) const; uint32_t GetStartAddress() const; void SetCompiledLocation(void * CompiledLoction); RspCodeType CodeType() const; bool IsEnd(uint32_t Address) const; bool IsValid() const; private: RspCodeBlock(); RspCodeBlock(const RspCodeBlock &); RspCodeBlock & operator=(const RspCodeBlock &); void Analyze(); RspCodeBlocks & m_Functions; const uint32_t m_EndBlockAddress; RSPInstructions m_Instructions; uint32_t m_StartAddress; RspCodeType m_CodeType; CRSPSystem & m_System; Addresses m_End; Addresses m_BranchTargets; Addresses m_FunctionCalls; void * m_CompiledLoction; bool m_Valid; };