diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-13 01:04:01 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-13 01:04:01 +0000 |
commit | 175c8e2e57befe2db15dd339ab5eb27d0c2b6013 (patch) | |
tree | b8aa20a5d67521db1fcc8f26cf939fc6448126b6 /include | |
parent | ecc65238c98ba21d08763da7b7972d617677e908 (diff) | |
download | clang-175c8e2e57befe2db15dd339ab5eb27d0c2b6013.tar.gz |
Speed-up ObjCMethodDecl::getOverriddenMethods().
Use an newly introduce ASTContext::getBaseObjCCategoriesAfterInterface() which caches its
results instead of re-calculating the categories multiple times.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/ASTContext.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index d4878a99a6..6a03eefbba 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -328,6 +328,10 @@ class ASTContext : public RefCountedBase<ASTContext> { typedef llvm::TinyPtrVector<const CXXMethodDecl*> CXXMethodVector; llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods; + /// \brief Used to cache results from \c getBaseObjCCategoriesAfterInterface. + mutable llvm::DenseMap<const ObjCInterfaceDecl *, + llvm::SmallVector<const ObjCCategoryDecl *, 2> > CatsAfterInterface; + /// \brief Mapping from each declaration context to its corresponding lambda /// mangling context. llvm::DenseMap<const DeclContext *, LambdaMangleContext> LambdaMangleContexts; @@ -682,7 +686,12 @@ public: void getOverriddenMethods( const NamedDecl *Method, SmallVectorImpl<const NamedDecl *> &Overridden) const; - + + /// \brief Returns the ObjC categories of base classes, that were declared + /// after the given interface declaration. + void getBaseObjCCategoriesAfterInterface(const ObjCInterfaceDecl *D, + SmallVectorImpl<const ObjCCategoryDecl *> &Cats) const; + /// \brief Notify the AST context that a new import declaration has been /// parsed or implicitly created within this translation unit. void addedLocalImportDecl(ImportDecl *Import); |