enum CSFC_Result

Description

CollectStatementsForCase - Given the body of a 'switch' statement and a constant value that is being switched on, see if we can dead code eliminate the body of the switch to a simple series of statements to emit. Basically, on a switch (5) we want to find these statements: case 5: printf(...); < -- ++i; < -- break; and add them to the ResultStmts vector. If it is unsafe to do this transformation (for example, one of the elided statements contains a label that might be jumped to), return CSFC_Failure. If we handled it and 'S' should include statements after it (e.g. the printf() line is a substmt of the case) then return CSFC_FallThrough. If we handled it and found a break statement, then return CSFC_Success. If Case is non-null, then we are looking for the specified case, checking that nothing we jump over contains labels. If Case is null, then we found the case and are looking for the break. If the recursive walk actually finds our Case, then we set FoundCase to true.

Declared at: clang/lib/CodeGen/CGStmt.cpp:1652

Enumerators

NameValueComment
CSFC_Failure0
CSFC_FallThrough1
CSFC_Success2