#include "Serialize.h"
#include "BitcodeWriter.h"
#include "clang/AST/Comment.h"
#include "clang/Index/USRGeneration.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/SHA1.h"
FullComment;
namespace clang {
namespace doc {
namespace serialize {
SymbolID hashUSR(llvm::StringRef USR) { … }
template <typename T>
static void
populateParentNamespaces(llvm::SmallVector<Reference, 4> &Namespaces,
const T *D, bool &IsAnonymousNamespace);
static void populateMemberTypeInfo(MemberTypeInfo &I, const FieldDecl *D);
llvm::SmallString<128>
getInfoRelativePath(const llvm::SmallVectorImpl<doc::Reference> &Namespaces) { … }
llvm::SmallString<128> getInfoRelativePath(const Decl *D) { … }
class ClangDocCommentVisitor
: public ConstCommentVisitor<ClangDocCommentVisitor> { … };
void ClangDocCommentVisitor::parseComment(const comments::Comment *C) { … }
void ClangDocCommentVisitor::visitTextComment(const TextComment *C) { … }
void ClangDocCommentVisitor::visitInlineCommandComment(
const InlineCommandComment *C) { … }
void ClangDocCommentVisitor::visitHTMLStartTagComment(
const HTMLStartTagComment *C) { … }
void ClangDocCommentVisitor::visitHTMLEndTagComment(
const HTMLEndTagComment *C) { … }
void ClangDocCommentVisitor::visitBlockCommandComment(
const BlockCommandComment *C) { … }
void ClangDocCommentVisitor::visitParamCommandComment(
const ParamCommandComment *C) { … }
void ClangDocCommentVisitor::visitTParamCommandComment(
const TParamCommandComment *C) { … }
void ClangDocCommentVisitor::visitVerbatimBlockComment(
const VerbatimBlockComment *C) { … }
void ClangDocCommentVisitor::visitVerbatimBlockLineComment(
const VerbatimBlockLineComment *C) { … }
void ClangDocCommentVisitor::visitVerbatimLineComment(
const VerbatimLineComment *C) { … }
bool ClangDocCommentVisitor::isWhitespaceOnly(llvm::StringRef S) const { … }
std::string ClangDocCommentVisitor::getCommandName(unsigned CommandID) const { … }
std::string getSourceCode(const Decl *D, const SourceRange &R) { … }
template <typename T> static std::string serialize(T &I) { … }
std::string serialize(std::unique_ptr<Info> &I) { … }
static void parseFullComment(const FullComment *C, CommentInfo &CI) { … }
static SymbolID getUSRForDecl(const Decl *D) { … }
static TagDecl *getTagDeclForType(const QualType &T) { … }
static RecordDecl *getRecordDeclForType(const QualType &T) { … }
TypeInfo getTypeInfoForType(const QualType &T) { … }
static bool isPublic(const clang::AccessSpecifier AS,
const clang::Linkage Link) { … }
static bool shouldSerializeInfo(bool PublicOnly, bool IsInAnonymousNamespace,
const NamedDecl *D) { … }
static void InsertChild(ScopeChildren &Scope, const NamespaceInfo &Info) { … }
static void InsertChild(ScopeChildren &Scope, const RecordInfo &Info) { … }
static void InsertChild(ScopeChildren &Scope, EnumInfo Info) { … }
static void InsertChild(ScopeChildren &Scope, FunctionInfo Info) { … }
static void InsertChild(ScopeChildren &Scope, TypedefInfo Info) { … }
template <typename ChildType>
std::unique_ptr<Info> MakeAndInsertIntoParent(ChildType Child) { … }
static AccessSpecifier getFinalAccessSpecifier(AccessSpecifier FirstAS,
AccessSpecifier SecondAS) { … }
static void parseFields(RecordInfo &I, const RecordDecl *D, bool PublicOnly,
AccessSpecifier Access = AccessSpecifier::AS_public) { … }
static void parseEnumerators(EnumInfo &I, const EnumDecl *D) { … }
static void parseParameters(FunctionInfo &I, const FunctionDecl *D) { … }
static void parseBases(RecordInfo &I, const CXXRecordDecl *D) { … }
template <typename T>
static void
populateParentNamespaces(llvm::SmallVector<Reference, 4> &Namespaces,
const T *D, bool &IsInAnonymousNamespace) { … }
void PopulateTemplateParameters(std::optional<TemplateInfo> &TemplateInfo,
const clang::Decl *D) { … }
TemplateParamInfo TemplateArgumentToInfo(const clang::Decl *D,
const TemplateArgument &Arg) { … }
template <typename T>
static void populateInfo(Info &I, const T *D, const FullComment *C,
bool &IsInAnonymousNamespace) { … }
template <typename T>
static void populateSymbolInfo(SymbolInfo &I, const T *D, const FullComment *C,
int LineNumber, StringRef Filename,
bool IsFileInRootDir,
bool &IsInAnonymousNamespace) { … }
static void populateFunctionInfo(FunctionInfo &I, const FunctionDecl *D,
const FullComment *FC, int LineNumber,
StringRef Filename, bool IsFileInRootDir,
bool &IsInAnonymousNamespace) { … }
static void populateMemberTypeInfo(MemberTypeInfo &I, const FieldDecl *D) { … }
static void
parseBases(RecordInfo &I, const CXXRecordDecl *D, bool IsFileInRootDir,
bool PublicOnly, bool IsParent,
AccessSpecifier ParentAccess = AccessSpecifier::AS_public) { … }
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
emitInfo(const NamespaceDecl *D, const FullComment *FC, int LineNumber,
llvm::StringRef File, bool IsFileInRootDir, bool PublicOnly) { … }
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber,
llvm::StringRef File, bool IsFileInRootDir, bool PublicOnly) { … }
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
emitInfo(const FunctionDecl *D, const FullComment *FC, int LineNumber,
llvm::StringRef File, bool IsFileInRootDir, bool PublicOnly) { … }
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
emitInfo(const CXXMethodDecl *D, const FullComment *FC, int LineNumber,
llvm::StringRef File, bool IsFileInRootDir, bool PublicOnly) { … }
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
emitInfo(const TypedefDecl *D, const FullComment *FC, int LineNumber,
StringRef File, bool IsFileInRootDir, bool PublicOnly) { … }
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
emitInfo(const TypeAliasDecl *D, const FullComment *FC, int LineNumber,
StringRef File, bool IsFileInRootDir, bool PublicOnly) { … }
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
emitInfo(const EnumDecl *D, const FullComment *FC, int LineNumber,
llvm::StringRef File, bool IsFileInRootDir, bool PublicOnly) { … }
}
}
}