]> granicus.if.org Git - clang/commitdiff
Fixup http://llvm.org/viewvc/llvm-project?rev=69165&view=rev (based on feedback from...
authorSteve Naroff <snaroff@apple.com>
Wed, 15 Apr 2009 17:31:31 +0000 (17:31 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 15 Apr 2009 17:31:31 +0000 (17:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69184 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
test/SemaObjC/scope-check-try-catch.m

index a2984657168d8243b2dc2724ff1bf2f0ab262e84..6233871c9efd1673d20c5d8fb17d4ece52cffc78 100644 (file)
@@ -2910,9 +2910,7 @@ static bool StatementCreatesScope(Stmt* S) {
           return true;
       }
     }
-  } else if (isa<ObjCAtTryStmt>(S)) {
-    return true;
-  }
+  } 
   return false;
 }
 
@@ -2928,6 +2926,15 @@ void Sema::RecursiveCalcLabelScopes(llvm::DenseMap<Stmt*, void*>& LabelScopeMap,
     if (StatementCreatesScope(*i))  {
       ScopeStack.push_back(*i);
       PopScopeMap[*i] = ParentCompoundStmt;
+    } else if (ObjCAtTryStmt *AT = dyn_cast<ObjCAtTryStmt>(*i)) {
+      ScopeStack.push_back(*i);
+      PopScopeMap[*i] = AT->getTryBody();
+    } else if (ObjCAtCatchStmt *AC = dyn_cast<ObjCAtCatchStmt>(*i)) {
+      ScopeStack.push_back(*i);
+      PopScopeMap[*i] = AC->getCatchBody();
+    } else if (ObjCAtFinallyStmt *AF = dyn_cast<ObjCAtFinallyStmt>(*i)) {
+      ScopeStack.push_back(*i);
+      PopScopeMap[*i] = AF->getFinallyBody();
     } else if (isa<LabelStmt>(CurStmt)) {
       LabelScopeMap[CurStmt] = ScopeStack.size() ? ScopeStack.back() : 0;
     }
index 2aac497784e6de3bdf93c7f846caf58ef343275b..d28cc85e9cc5cb171f78138954ae61b7b1a2a4f5 100644 (file)
@@ -17,12 +17,9 @@ L3: ;
   }
 }
 
-#if 0
-// FIXME
 void f0(int a) {
   if (a) goto L0;
   @try {} @finally {}
  L0:
   return;
 }
-#endif