diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-26 17:57:08 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-26 17:57:08 +0000 |
commit | f4e837f66ce6d9b4e5f91d2528d3d30114f080a2 (patch) | |
tree | a629f970cf0951cc799a9bb6bed91844e0ae0f4d /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 5de7f6e02be6b93281a05cfae5aa7838b2bf1b7e (diff) | |
download | bcm5719-llvm-f4e837f66ce6d9b4e5f91d2528d3d30114f080a2.tar.gz bcm5719-llvm-f4e837f66ce6d9b4e5f91d2528d3d30114f080a2.zip |
Implement template instantiation for Objective-C @catch
statements. This is the last of the Objective-C statements.
llvm-svn: 102356
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index abc8e5fb560..6fdf243d7bb 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -589,6 +589,11 @@ namespace { IdentifierInfo *Name, SourceLocation Loc, SourceRange TypeRange); + /// \brief Rebuild the Objective-C exception declaration and register the + /// declaration as an instantiated local. + VarDecl *RebuildObjCExceptionDecl(VarDecl *ExceptionDecl, + TypeSourceInfo *TSInfo, QualType T); + /// \brief Check for tag mismatches when instantiating an /// elaborated type. QualType RebuildElaboratedType(QualType T, ElaboratedType::TagKind Tag); @@ -687,7 +692,16 @@ TemplateInstantiator::RebuildExceptionDecl(VarDecl *ExceptionDecl, SourceRange TypeRange) { VarDecl *Var = inherited::RebuildExceptionDecl(ExceptionDecl, T, Declarator, Name, Loc, TypeRange); - if (Var && !Var->isInvalidDecl()) + if (Var) + getSema().CurrentInstantiationScope->InstantiatedLocal(ExceptionDecl, Var); + return Var; +} + +VarDecl *TemplateInstantiator::RebuildObjCExceptionDecl(VarDecl *ExceptionDecl, + TypeSourceInfo *TSInfo, + QualType T) { + VarDecl *Var = inherited::RebuildObjCExceptionDecl(ExceptionDecl, TSInfo, T); + if (Var) getSema().CurrentInstantiationScope->InstantiatedLocal(ExceptionDecl, Var); return Var; } |