diff options
Diffstat (limited to 'clang/lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 1d9b30eca84..b042261ec38 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -217,34 +217,6 @@ void CodeGenFunction::EmitIndirectGotoStmt(const IndirectGotoStmt &S) { EmitDummyBlock(); } -/// ContainsLabel - Return true if the statement contains a label in it. If -/// this statement is not executed normally, it not containing a label means -/// that we can just remove the code. -static bool ContainsLabel(const Stmt *S, bool IgnoreCaseStmts = false) { - // If this is a label, we have to emit the code, consider something like: - // if (0) { ... foo: bar(); } goto foo; - if (isa<LabelStmt>(S)) - return true; - - // If this is a case/default statement, and we haven't seen a switch, we have - // to emit the code. - if (isa<SwitchCase>(S) && !IgnoreCaseStmts) - return true; - - // If this is a switch statement, we want to ignore cases below it. - if (isa<SwitchStmt>(S)) - IgnoreCaseStmts = true; - - // Scan subexpressions for verboten labels. - for (Stmt::const_child_iterator I = S->child_begin(), E = S->child_end(); - I != E; ++I) - if (ContainsLabel(*I, IgnoreCaseStmts)) - return true; - - return false; -} - - void CodeGenFunction::EmitIfStmt(const IfStmt &S) { // C99 6.8.4.1: The first substatement is executed if the expression compares // unequal to 0. The condition must be a scalar type. |