void CCodeSection::UnlinkParent( CCodeSection * Parent, bool AllowDelete, bool ContinueSection ) { if (this == NULL) { return; } SECTION_LIST::iterator iter = ParentSection.begin(); while ( iter != ParentSection.end()) { CCodeSection * ParentIter = *iter; if (ParentIter == Parent && (Parent->ContinueSection != this || Parent->JumpSection != this)) { ParentSection.erase(iter); iter = ParentSection.begin(); } else { iter++; } } // if (Parent->ContinueSection != Parent->JumpSection) // { // if (!ContinueSection && Parent->ContinueSection == this) // { // g_Notify->BreakPoint(__FILEW__,__LINE__); // } // } if (ContinueSection && Parent->ContinueSection == this) { Parent->ContinueSection = NULL; } // if (Parent->ContinueSection != Parent->JumpSection) // { // if (ContinueSection && Parent->JumpSection == this) // { // g_Notify->BreakPoint(__FILEW__,__LINE__); // } // } if (!ContinueSection && Parent->JumpSection == this) { Parent->JumpSection = NULL; } if (AllowDelete) { bool KillMe = true; for (SECTION_LIST::iterator iter = ParentSection.begin(); iter != ParentSection.end(); iter++) { if (!IsAllParentLoops(*iter,false,GetNewTestValue())) { KillMe = false; break; } } if (KillMe) { delete this; } } }
bool CCodeSection::IsAllParentLoops(CCodeSection * Parent, bool IgnoreIfCompiled, uint32_t Test) { if (IgnoreIfCompiled && Parent->CompiledLocation != NULL) { return true; } if (!InLoop) { return false; } if (!Parent->InLoop) { return false; } if (Parent->ParentSection.empty()) { return false; } if (this == Parent) { return true; } if (Parent->Test == Test) { return true; } Parent->Test = Test; for (SECTION_LIST::iterator iter = Parent->ParentSection.begin(); iter != Parent->ParentSection.end(); iter++) { CCodeSection * ParentSection = *iter; if (!IsAllParentLoops(ParentSection,IgnoreIfCompiled,Test)) { return false; } } return true; }
bool CCodeSection::ParentContinue() { if (m_ParentSection.size() > 0) { for (SECTION_LIST::iterator iter = m_ParentSection.begin(); iter != m_ParentSection.end(); iter++) { CCodeSection * Parent = *iter; if (Parent->m_CompiledLocation != NULL) { continue; } if (IsAllParentLoops(Parent, true, m_BlockInfo->NextTest())) { continue; } return false; } m_RecompilerOps->SetCurrentSection(this); if (!m_RecompilerOps->InheritParentInfo()) { return false; } } return true; }