void TransformWCR::UnwrapStmtList(StmtVector &Stmts, StmtVector &Body) { for (unsigned i = 0, e = Body.size(); i < e; i++) { CompoundStmt *CS = dyn_cast<CompoundStmt>(Body[i]); if (CS && CS->isStmtList()) { SerializeStmtList(Stmts, CS); } else { Stmts.push_back(Body[i]); } } }
//--------------------------------------------------------------------------- void TransformWCR::SerializeStmtList(StmtVector &Stmts, CompoundStmt *SL) { for (CompoundStmt::body_iterator I = SL->body_begin(), E = SL->body_end(); I != E; ++I) { CompoundStmt *CS = dyn_cast<CompoundStmt>(*I); if (CS && CS->isStmtList()) SerializeStmtList(Stmts, CS); else Stmts.push_back(*I); } ASTCtx.Deallocate(SL); }