aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-02-03 00:32:51 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-02-03 00:32:51 +0000
commitd219a3a462c31fc9aa0c0bcfb749e9e8e56b5e35 (patch)
tree9a788b861339accfb5c2b587efd7e358380af939 /lib/Sema/SemaDecl.cpp
parenta873dfc9e7314681bb37efd9ab185045de121e43 (diff)
Simplify setting of DeclContext for @catch variable
(per Doug's comment). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95169 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 8c217f8e0d..d203376f91 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3936,15 +3936,7 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) {
void Sema::ActOnObjCCatchParam(DeclPtrTy D) {
ParmVarDecl *Param = cast<ParmVarDecl>(D.getAs<Decl>());
-
- if (FunctionDecl *Function = dyn_cast<FunctionDecl>(CurContext))
- Param->setDeclContext(Function);
- else if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(CurContext))
- Param->setDeclContext(MD);
- else if (BlockDecl *BD = dyn_cast<BlockDecl>(CurContext))
- Param->setDeclContext(BD);
- // FIXME. Other contexts?
-
+ Param->setDeclContext(CurContext);
}
void Sema::ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,