From 31efe7f74b65e702de53f89e2000ba537f27ecc6 Mon Sep 17 00:00:00 2001 From: whh8b <whh8b@git.zephyr-software.com> Date: Thu, 28 Jan 2016 05:52:00 +0000 Subject: [PATCH] Track FallthroughPatched and Coalesced status FallthroughPatched: This is whether or not the fallthrough to the subsequent dollop has been converted into a jump instruction that has been added to the dollop. This affects future size calculations. Coalesced: This is whether or not this dollop has been coalesced with its fallthrough dollop. This affects size calculations. --- include/dollop.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/dollop.h b/include/dollop.h index be6940e..965e0d9 100644 --- a/include/dollop.h +++ b/include/dollop.h @@ -89,7 +89,12 @@ class Dollop_t : public Placeable_t, public std::list<DollopEntry_t*> { static Dollop_t *CreateNewDollop(libIRDB::Instruction_t *start); Dollop_t(libIRDB::Instruction_t *start); - Dollop_t() { m_size = 0; m_was_truncated = false; } + Dollop_t() : + m_size(0), + m_fallthrough_dollop(NULL), + m_fallthrough_patched(false), + m_coalesced(false), + m_was_truncated(false) {} size_t GetSize() const { return m_size; @@ -108,16 +113,23 @@ class Dollop_t : public Placeable_t, public std::list<DollopEntry_t*> { m_fallthrough_dollop = fallthrough; } Dollop_t *FallthroughDollop(void) const { return m_fallthrough_dollop; } + bool FallthroughPatched(void) const { return m_fallthrough_patched; } + void FallthroughPatched(bool patched); DollopEntry_t *FallthroughDollopEntry(DollopEntry_t *) const; void WasTruncated(bool truncated) { m_was_truncated = truncated; } bool WasTruncated(void) const { return m_was_truncated; } + void WasCoalesced(bool coalesced); + bool WasCoalesced(void) const { return m_coalesced; } + private: size_t CalculateWorstCaseSize(); size_t m_size; Dollop_t *m_fallthrough_dollop; + bool m_fallthrough_patched; + bool m_coalesced; bool m_was_truncated; }; } -- GitLab