Lines Matching full:cases

40 static TArray<const SwitchCase*> find_duplicate_case_values(const StatementArray& cases) {  in find_duplicate_case_values()  argument
45 for (const std::unique_ptr<Statement>& stmt : cases) { in find_duplicate_case_values()
85 // This function reduces a switch to the matching case (or cases, if fallthrough occurs) when in block_for_case()
91 // succeed, so before we make any changes at all, we check the switch-cases to decide on a plan in block_for_case()
95 StatementArray& cases = caseBlock->as<Block>().children(); in block_for_case() local
96 auto iter = cases.begin(); in block_for_case()
97 for (; iter != cases.end(); ++iter) { in block_for_case()
109 for (; iter != cases.end(); ++iter) { in block_for_case()
112 // We can't reduce switch-cases to a block when they have conditional exits. in block_for_case()
131 cases[index] = std::move((*startIter)->as<SwitchCase>().statement()); in block_for_case()
135 cases.pop_back_n(cases.size() - numElements); in block_for_case()
139 remove_break_statements(cases.back()); in block_for_case()
159 StatementArray cases; in Convert() local
174 cases.push_back(SwitchCase::Make(casePos, intValue, std::move(caseStatements[i]))); in Convert()
176 cases.push_back(SwitchCase::MakeDefault(pos, std::move(caseStatements[i]))); in Convert()
181 TArray<const SwitchCase*> duplicateCases = find_duplicate_case_values(cases); in Convert()
198 // inherited from earlier fall-through cases. (oss-fuzz:70589) in Convert()
200 Transform::HoistSwitchVarDeclarationsAtTopLevel(context, cases, *symbolTable, pos); in Convert()
204 Block::MakeBlock(pos, std::move(cases), Block::Kind::kBracedScope, in Convert()
220 // Confirm that every statement in `cases` is a SwitchCase. in Make()
221 const StatementArray& cases = caseBlock->as<Block>().children(); in Make() local
222 SkASSERT(std::all_of(cases.begin(), cases.end(), [&](const std::unique_ptr<Statement>& stmt) { in Make()
227 SkASSERT(find_duplicate_case_values(cases).empty()); in Make()
235 for (const std::unique_ptr<Statement>& stmt : cases) { in Make()