summaryrefslogtreecommitdiffstats
path: root/include/clang/AST/ASTContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/ASTContext.h')
-rw-r--r--include/clang/AST/ASTContext.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index 8fd7d6e..cad3ad2 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -474,8 +474,17 @@ public:
Data.setPointer(RC);
}
+ const Decl *getOriginalDecl() const LLVM_READONLY {
+ return OriginalDecl;
+ }
+
+ void setOriginalDecl(const Decl *Orig) {
+ OriginalDecl = Orig;
+ }
+
private:
llvm::PointerIntPair<const RawComment *, 2, Kind> Data;
+ const Decl *OriginalDecl;
};
/// \brief Mapping from declarations to comments attached to any
@@ -485,6 +494,10 @@ public:
/// lazily.
mutable llvm::DenseMap<const Decl *, RawCommentAndCacheFlags> RedeclComments;
+ /// \brief Mapping from declarations to parsed comments attached to any
+ /// redeclaration.
+ mutable llvm::DenseMap<const Decl *, comments::FullComment *> ParsedComments;
+
/// \brief Return the documentation comment attached to a given declaration,
/// without looking into cache.
RawComment *getRawCommentForDeclNoCache(const Decl *D) const;
@@ -500,7 +513,12 @@ public:
/// \brief Return the documentation comment attached to a given declaration.
/// Returns NULL if no comment is attached.
- const RawComment *getRawCommentForAnyRedecl(const Decl *D) const;
+ ///
+ /// \param OriginalDecl if not NULL, is set to declaration AST node that had
+ /// the comment, if the comment we found comes from a redeclaration.
+ const RawComment *getRawCommentForAnyRedecl(
+ const Decl *D,
+ const Decl **OriginalDecl = NULL) const;
/// Return parsed documentation comment attached to a given declaration.
/// Returns NULL if no comment is attached.
OpenPOWER on IntegriCloud