diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-04 21:44:35 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-04 21:44:35 +0000 |
commit | c91e9f439ae85d5f79a6b65672f1d7d1b55ccda0 (patch) | |
tree | b4f0c79bca8661b61ce7be28a74f0d05db68accd /lib/AST | |
parent | 5586b019c18024b2967d027a17d5a05584a8b181 (diff) |
Read/write more information of ASTContext for PCH. Overriden methods and instantiated-from information.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/ASTContext.cpp | 10 | ||||
-rw-r--r-- | lib/AST/DeclCXX.cpp | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 24ddb127bd..4fb9d369de 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -478,6 +478,16 @@ ASTContext::overridden_methods_end(const CXXMethodDecl *Method) const { return Pos->second.end(); } +unsigned +ASTContext::overridden_methods_size(const CXXMethodDecl *Method) const { + llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector>::const_iterator Pos + = OverriddenMethods.find(Method); + if (Pos == OverriddenMethods.end()) + return 0; + + return Pos->second.size(); +} + void ASTContext::addOverriddenMethod(const CXXMethodDecl *Method, const CXXMethodDecl *Overridden) { OverriddenMethods[Method].push_back(Overridden); diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index 7ce9c64de0..19c3ac1011 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -716,6 +716,10 @@ CXXMethodDecl::method_iterator CXXMethodDecl::end_overridden_methods() const { return getASTContext().overridden_methods_end(this); } +unsigned CXXMethodDecl::size_overridden_methods() const { + return getASTContext().overridden_methods_size(this); +} + QualType CXXMethodDecl::getThisType(ASTContext &C) const { // C++ 9.3.2p1: The type of this in a member function of a class X is X*. // If the member function is declared const, the type of this is const X*, |