Commit 1b0bfaab authored by Jean-Philip Desjardins's avatar Jean-Philip Desjardins
Browse files

Fix formatting.

parent d248ddda
......@@ -360,5 +360,4 @@ void CBasicBlock::EmptyBlockHandler(CMIPS* context)
void CBasicBlock::NextBlockTrampoline(CMIPS* context)
{
}
......@@ -370,32 +370,31 @@ protected:
void OrphanBlock(CBasicBlock* block)
{
auto orphanBlockLinkSlot =
[&](CBasicBlock::LINK_SLOT linkSlot)
{
auto slotSearch =
[&](const std::pair<uint32, BLOCK_LINK>& link) {
return (link.second.address == block->GetBeginAddress()) &&
(link.second.slot == linkSlot);
};
uint32 linkTargetAddress = block->GetLinkTargetAddress(linkSlot);
//Check if block has this specific link slot
if(linkTargetAddress != MIPS_INVALID_PC)
{
//If it has that link slot, it's either linked or pending to be linked
auto slotIterator = std::find_if(m_blockLinks.begin(), m_blockLinks.end(), slotSearch);
if(slotIterator != std::end(m_blockLinks))
{
block->UnlinkBlock(linkSlot);
m_blockLinks.erase(slotIterator);
}
else
{
slotIterator = std::find_if(m_pendingBlockLinks.begin(), m_pendingBlockLinks.end(), slotSearch);
assert(slotIterator != std::end(m_pendingBlockLinks));
m_pendingBlockLinks.erase(slotIterator);
}
}
};
[&](CBasicBlock::LINK_SLOT linkSlot) {
auto slotSearch =
[&](const std::pair<uint32, BLOCK_LINK>& link) {
return (link.second.address == block->GetBeginAddress()) &&
(link.second.slot == linkSlot);
};
uint32 linkTargetAddress = block->GetLinkTargetAddress(linkSlot);
//Check if block has this specific link slot
if(linkTargetAddress != MIPS_INVALID_PC)
{
//If it has that link slot, it's either linked or pending to be linked
auto slotIterator = std::find_if(m_blockLinks.begin(), m_blockLinks.end(), slotSearch);
if(slotIterator != std::end(m_blockLinks))
{
block->UnlinkBlock(linkSlot);
m_blockLinks.erase(slotIterator);
}
else
{
slotIterator = std::find_if(m_pendingBlockLinks.begin(), m_pendingBlockLinks.end(), slotSearch);
assert(slotIterator != std::end(m_pendingBlockLinks));
m_pendingBlockLinks.erase(slotIterator);
}
}
};
orphanBlockLinkSlot(CBasicBlock::LINK_SLOT_NEXT);
orphanBlockLinkSlot(CBasicBlock::LINK_SLOT_BRANCH);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment