Branch analyser fixups

This commit is contained in:
Sajid
2024-09-11 08:58:50 +06:00
parent 8d9a35a0f3
commit cbc914a43d
3 changed files with 54 additions and 28 deletions

View File

@@ -1,12 +1,19 @@
#pragma once
#include <vector>
#ifdef _DEBUG(X)
#define DEBUG(X) X
#else
#define DEBUG(X)
#endif
struct Function
{
struct Block
{
size_t base{};
size_t size{};
DEBUG(size_t parent{});
// scratch
size_t projectedSize{ static_cast<size_t>(-1) };
@@ -15,7 +22,7 @@ struct Function
size_t base{};
size_t size{};
std::vector<Block> blocks{};
size_t SearchBlock(size_t address) const;
static Function Analyze(const void* code, size_t size, size_t base);
};