//--------------------------------------------------------- void removeGotosToNextLabel(StmtEditor& editor, Stmt* Node) { RemoveGotosToNextLabel visitor(editor); visit_df(Node, visitor); for (RemoveGotosToNextLabel::tTouchedLabels::iterator i = visitor.m_TouchedLabels.begin(), e = visitor.m_TouchedLabels.end(); i != e; ++i) { if (!i->second.m_Used) { LabelStmt* LS = i->second.LS; assert(LS); CompoundStmt* CS = dyn_cast<CompoundStmt>(editor.getParent(LS)); if (CS && CS->size() > 1 && isa<NullStmt>(LS->getSubStmt())) { editor.removeStmt(CS, LS); } else { editor.replaceStatement(LS, LS->getSubStmt()); } } } }
void CodeGenFunction::EmitLabelStmt(const LabelStmt &S) { EmitLabel(S); EmitStmt(S.getSubStmt()); }