[llvm-branch-commits] [cfe-branch] r110129 - in /cfe/branches/Apple/whitney-IB/src/tools/clang: ./ lib/Sema/JumpDiagnostics.cpp

Daniel Dunbar daniel at zuster.org
Tue Aug 3 11:24:07 PDT 2010


Author: ddunbar
Date: Tue Aug  3 13:24:07 2010
New Revision: 110129

URL: http://llvm.org/viewvc/llvm-project?rev=110129&view=rev
Log:
--- Merging r110071 into 'src/tools/clang':
U    src/tools/clang/lib/Sema/JumpDiagnostics.cpp


Modified:
    cfe/branches/Apple/whitney-IB/src/tools/clang/   (props changed)
    cfe/branches/Apple/whitney-IB/src/tools/clang/lib/Sema/JumpDiagnostics.cpp

Propchange: cfe/branches/Apple/whitney-IB/src/tools/clang/
------------------------------------------------------------------------------
    svn:mergeinfo = /cfe/trunk:110071

Modified: cfe/branches/Apple/whitney-IB/src/tools/clang/lib/Sema/JumpDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/tools/clang/lib/Sema/JumpDiagnostics.cpp?rev=110129&r1=110128&r2=110129&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/tools/clang/lib/Sema/JumpDiagnostics.cpp (original)
+++ cfe/branches/Apple/whitney-IB/src/tools/clang/lib/Sema/JumpDiagnostics.cpp Tue Aug  3 13:24:07 2010
@@ -182,9 +182,19 @@
   switch (S->getStmtClass()) {
   case Stmt::LabelStmtClass:
   case Stmt::DefaultStmtClass:
-  case Stmt::CaseStmtClass:
     LabelAndGotoScopes[S] = ParentScope;
     break;
+  case Stmt::CaseStmtClass: {
+    // Specially handle CaseStmts since they can nest each other in the
+    // AST and blow out the stack when we walk them.
+    CaseStmt *CS = cast<CaseStmt>(S);
+    do {
+      LabelAndGotoScopes[CS] = ParentScope;
+      S = CS; // 'CS' is the new current statement (if it isn't already).
+      CS = dyn_cast<CaseStmt>(CS->getSubStmt());
+    } while (CS);
+    break;
+  }
 
   case Stmt::AddrLabelExprClass:
     IndirectJumpTargets.push_back(cast<AddrLabelExpr>(S)->getLabel());





More information about the llvm-branch-commits mailing list