From: Steve Naroff Date: Wed, 15 Apr 2009 17:31:31 +0000 (+0000) Subject: Fixup http://llvm.org/viewvc/llvm-project?rev=69165&view=rev (based on feedback from... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3bf449796233175e0a696f17fad97fb6d72be48f;p=clang Fixup http://llvm.org/viewvc/llvm-project?rev=69165&view=rev (based on feedback from Eli). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69184 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index a298465716..6233871c9e 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2910,9 +2910,7 @@ static bool StatementCreatesScope(Stmt* S) { return true; } } - } else if (isa(S)) { - return true; - } + } return false; } @@ -2928,6 +2926,15 @@ void Sema::RecursiveCalcLabelScopes(llvm::DenseMap& LabelScopeMap, if (StatementCreatesScope(*i)) { ScopeStack.push_back(*i); PopScopeMap[*i] = ParentCompoundStmt; + } else if (ObjCAtTryStmt *AT = dyn_cast(*i)) { + ScopeStack.push_back(*i); + PopScopeMap[*i] = AT->getTryBody(); + } else if (ObjCAtCatchStmt *AC = dyn_cast(*i)) { + ScopeStack.push_back(*i); + PopScopeMap[*i] = AC->getCatchBody(); + } else if (ObjCAtFinallyStmt *AF = dyn_cast(*i)) { + ScopeStack.push_back(*i); + PopScopeMap[*i] = AF->getFinallyBody(); } else if (isa(CurStmt)) { LabelScopeMap[CurStmt] = ScopeStack.size() ? ScopeStack.back() : 0; } diff --git a/test/SemaObjC/scope-check-try-catch.m b/test/SemaObjC/scope-check-try-catch.m index 2aac497784..d28cc85e9c 100644 --- a/test/SemaObjC/scope-check-try-catch.m +++ b/test/SemaObjC/scope-check-try-catch.m @@ -17,12 +17,9 @@ L3: ; } } -#if 0 -// FIXME void f0(int a) { if (a) goto L0; @try {} @finally {} L0: return; } -#endif