diff options
Diffstat (limited to 'include/clang/AST/ASTContext.h')
-rw-r--r-- | include/clang/AST/ASTContext.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 6ceed17eb8..172ac88edf 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -27,6 +27,7 @@ #include "clang/AST/TemplateName.h" #include "clang/AST/Type.h" #include "clang/AST/CanonicalType.h" +#include "clang/Comments/RawCommentList.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" @@ -51,7 +52,6 @@ namespace clang { class ASTMutationListener; class IdentifierTable; class SelectorTable; - class SourceManager; class TargetInfo; class CXXABI; // Decls @@ -418,6 +418,30 @@ public: return FullSourceLoc(Loc,SourceMgr); } + /// \brief All comments in this translation unit. + RawCommentList Comments; + + /// \brief True if comments are already loaded from ExternalASTSource. + mutable bool CommentsLoaded; + + /// \brief Mapping from declarations to their comments (stored within + /// Comments list), once we have already looked up the comment associated + /// with a given declaration. + mutable llvm::DenseMap<const Decl *, const RawComment *> DeclComments; + + /// \brief Return the Doxygen-style comment attached to a given declaration, + /// without looking into cache. + const RawComment *getRawCommentForDeclNoCache(const Decl *D) const; + +public: + void addComment(const RawComment &RC) { + Comments.addComment(RC, *this); + } + + /// \brief Return the Doxygen-style comment attached to a given declaration. + /// Returns NULL if no comment is attached. + const RawComment *getRawCommentForDecl(const Decl *D) const; + /// \brief Retrieve the attributes for the given declaration. AttrVec& getDeclAttrs(const Decl *D); |