[cfe-commits] r69184 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaObjC/scope-check-try-catch.m

Steve Naroff snaroff at apple.com
Wed Apr 15 10:31:48 PDT 2009


Author: snaroff
Date: Wed Apr 15 12:31:31 2009
New Revision: 69184

URL: http://llvm.org/viewvc/llvm-project?rev=69184&view=rev
Log:
Fixup http://llvm.org/viewvc/llvm-project?rev=69165&view=rev (based on feedback from Eli).


Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/test/SemaObjC/scope-check-try-catch.m

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=69184&r1=69183&r2=69184&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Apr 15 12:31:31 2009
@@ -2910,9 +2910,7 @@
           return true;
       }
     }
-  } else if (isa<ObjCAtTryStmt>(S)) {
-    return true;
-  }
+  } 
   return false;
 }
 
@@ -2928,6 +2926,15 @@
     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;
     }

Modified: cfe/trunk/test/SemaObjC/scope-check-try-catch.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/scope-check-try-catch.m?rev=69184&r1=69183&r2=69184&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/scope-check-try-catch.m (original)
+++ cfe/trunk/test/SemaObjC/scope-check-try-catch.m Wed Apr 15 12:31:31 2009
@@ -17,12 +17,9 @@
   }
 }
 
-#if 0
-// FIXME
 void f0(int a) {
   if (a) goto L0;
   @try {} @finally {}
  L0:
   return;
 }
-#endif





More information about the cfe-commits mailing list