clang-tools 22.0.0git
clang::doc::serialize Namespace Reference

Classes

class  ClangDocCommentVisitor

Functions

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 Decl *D)
static void populateMemberTypeInfo (RecordInfo &I, AccessSpecifier &Access, const DeclaratorDecl *D, bool IsStatic=false)
static void getTemplateParameters (const TemplateParameterList *TemplateParams, llvm::raw_ostream &Stream)
static llvm::SmallString< 256 > getFunctionPrototype (const FunctionDecl *FuncDecl)
static llvm::SmallString< 16 > getTypeAlias (const TypeAliasDecl *Alias)
static llvm::SmallString< 16 > getRecordPrototype (const CXXRecordDecl *CXXRD)
static llvm::SmallString< 128 > getInfoRelativePath (const llvm::SmallVectorImpl< doc::Reference > &Namespaces)
static llvm::SmallString< 128 > getInfoRelativePath (const Decl *D)
static 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)
static TypeInfo getTypeInfoForType (const QualType &T, const PrintingPolicy &Policy)
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)
static void InsertChild (ScopeChildren &Scope, ConceptInfo Info)
static void InsertChild (ScopeChildren &Scope, VarInfo Info)
template<typename ChildType>
static std::unique_ptr< InfomakeAndInsertIntoParent (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)
static void populateTemplateParameters (std::optional< TemplateInfo > &TemplateInfo, const clang::Decl *D)
static TemplateParamInfo convertTemplateArgToInfo (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, Location Loc, bool &IsInAnonymousNamespace)
static void handleCompoundConstraints (const Expr *Constraint, std::vector< ConstraintInfo > &ConstraintInfos)
static void populateConstraints (TemplateInfo &I, const TemplateDecl *D)
static void populateFunctionInfo (FunctionInfo &I, const FunctionDecl *D, const FullComment *FC, Location Loc, bool &IsInAnonymousNamespace)
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, Location Loc, bool PublicOnly)
static void parseFriends (RecordInfo &RI, const CXXRecordDecl *D)
std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > emitInfo (const RecordDecl *D, const FullComment *FC, Location Loc, bool PublicOnly)
std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > emitInfo (const FunctionDecl *D, const FullComment *FC, Location Loc, bool PublicOnly)
std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > emitInfo (const CXXMethodDecl *D, const FullComment *FC, Location Loc, bool PublicOnly)
static void extractCommentFromDecl (const Decl *D, TypedefInfo &Info)
std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > emitInfo (const TypedefDecl *D, const FullComment *FC, Location Loc, bool PublicOnly)
std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > emitInfo (const TypeAliasDecl *D, const FullComment *FC, Location Loc, bool PublicOnly)
std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > emitInfo (const EnumDecl *D, const FullComment *FC, Location Loc, bool PublicOnly)
std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > emitInfo (const ConceptDecl *D, const FullComment *FC, const Location &Loc, bool PublicOnly)
std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > emitInfo (const VarDecl *D, const FullComment *FC, const Location &Loc, bool PublicOnly)
std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > emitInfo (const VarDecl *D, const FullComment *FC, int LineNumber, StringRef File, bool IsFileInRootDir, bool PublicOnly)

Function Documentation

◆ convertTemplateArgToInfo()

TemplateParamInfo clang::doc::serialize::convertTemplateArgToInfo ( const clang::Decl * D,
const TemplateArgument & Arg )
static

Definition at line 736 of file Serialize.cpp.

Referenced by emitInfo(), and populateFunctionInfo().

◆ emitInfo() [1/10]

std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > clang::doc::serialize::emitInfo ( const ConceptDecl * D,
const FullComment * FC,
const Location & Loc,
bool PublicOnly )

◆ emitInfo() [2/10]

std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > clang::doc::serialize::emitInfo ( const CXXMethodDecl * D,
const FullComment * FC,
Location Loc,
bool PublicOnly )

◆ emitInfo() [3/10]

std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > clang::doc::serialize::emitInfo ( const EnumDecl * D,
const FullComment * FC,
Location Loc,
bool PublicOnly )

◆ emitInfo() [4/10]

std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > clang::doc::serialize::emitInfo ( const FunctionDecl * D,
const FullComment * FC,
Location Loc,
bool PublicOnly )

◆ emitInfo() [5/10]

std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > clang::doc::serialize::emitInfo ( const NamespaceDecl * D,
const FullComment * FC,
Location Loc,
bool PublicOnly )

◆ emitInfo() [6/10]

std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > clang::doc::serialize::emitInfo ( const RecordDecl * D,
const FullComment * FC,
Location Loc,
bool PublicOnly )

◆ emitInfo() [7/10]

std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > clang::doc::serialize::emitInfo ( const TypeAliasDecl * D,
const FullComment * FC,
Location Loc,
bool PublicOnly )

◆ emitInfo() [8/10]

std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > clang::doc::serialize::emitInfo ( const TypedefDecl * D,
const FullComment * FC,
Location Loc,
bool PublicOnly )

◆ emitInfo() [9/10]

std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > clang::doc::serialize::emitInfo ( const VarDecl * D,
const FullComment * FC,
const Location & Loc,
bool PublicOnly )

◆ emitInfo() [10/10]

std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > clang::doc::serialize::emitInfo ( const VarDecl * D,
const FullComment * FC,
int LineNumber,
StringRef File,
bool IsFileInRootDir,
bool PublicOnly )

References PublicOnly(), and serialize().

◆ extractCommentFromDecl()

void clang::doc::serialize::extractCommentFromDecl ( const Decl * D,
TypedefInfo & Info )
static

Definition at line 1137 of file Serialize.cpp.

References clang::doc::Info::Description, and parseFullComment().

Referenced by emitInfo(), and emitInfo().

◆ getFinalAccessSpecifier()

AccessSpecifier clang::doc::serialize::getFinalAccessSpecifier ( AccessSpecifier FirstAS,
AccessSpecifier SecondAS )
static

Definition at line 585 of file Serialize.cpp.

Referenced by parseBases(), and populateMemberTypeInfo().

◆ getFunctionPrototype()

llvm::SmallString< 256 > clang::doc::serialize::getFunctionPrototype ( const FunctionDecl * FuncDecl)
static

Definition at line 98 of file Serialize.cpp.

References FuncDecl, and getTemplateParameters().

Referenced by populateFunctionInfo().

◆ getInfoRelativePath() [1/2]

llvm::SmallString< 128 > clang::doc::serialize::getInfoRelativePath ( const Decl * D)
static

Definition at line 251 of file Serialize.cpp.

References getInfoRelativePath(), and populateParentNamespaces().

◆ getInfoRelativePath() [2/2]

llvm::SmallString< 128 > clang::doc::serialize::getInfoRelativePath ( const llvm::SmallVectorImpl< doc::Reference > & Namespaces)
static

◆ getRecordDeclForType()

RecordDecl * clang::doc::serialize::getRecordDeclForType ( const QualType & T)
static

Definition at line 435 of file Serialize.cpp.

Referenced by parseBases().

◆ getRecordPrototype()

llvm::SmallString< 16 > clang::doc::serialize::getRecordPrototype ( const CXXRecordDecl * CXXRD)
static

Definition at line 182 of file Serialize.cpp.

Referenced by emitInfo().

◆ getSourceCode()

std::string clang::doc::serialize::getSourceCode ( const Decl * D,
const SourceRange & R )
static

◆ getTagDeclForType()

TagDecl * clang::doc::serialize::getTagDeclForType ( const QualType & T)
static

Definition at line 429 of file Serialize.cpp.

Referenced by getTypeInfoForType().

◆ getTemplateParameters()

void clang::doc::serialize::getTemplateParameters ( const TemplateParameterList * TemplateParams,
llvm::raw_ostream & Stream )
static

Definition at line 52 of file Serialize.cpp.

References getTemplateParameters().

Referenced by getFunctionPrototype(), getTemplateParameters(), and getTypeAlias().

◆ getTypeAlias()

llvm::SmallString< 16 > clang::doc::serialize::getTypeAlias ( const TypeAliasDecl * Alias)
static

Definition at line 168 of file Serialize.cpp.

References getTemplateParameters().

Referenced by emitInfo().

◆ getTypeInfoForType()

◆ getUSRForDecl()

◆ handleCompoundConstraints()

void clang::doc::serialize::handleCompoundConstraints ( const Expr * Constraint,
std::vector< ConstraintInfo > & ConstraintInfos )
static

◆ hashUSR()

SymbolID clang::doc::serialize::hashUSR ( llvm::StringRef USR)

Definition at line 38 of file Serialize.cpp.

Referenced by getUSRForDecl().

◆ InsertChild() [1/7]

void clang::doc::serialize::InsertChild ( ScopeChildren & Scope,
ConceptInfo Info )
static

Definition at line 514 of file Serialize.cpp.

References clang::doc::ScopeChildren::Concepts.

◆ InsertChild() [2/7]

void clang::doc::serialize::InsertChild ( ScopeChildren & Scope,
const NamespaceInfo & Info )
static

◆ InsertChild() [3/7]

void clang::doc::serialize::InsertChild ( ScopeChildren & Scope,
const RecordInfo & Info )
static

◆ InsertChild() [4/7]

void clang::doc::serialize::InsertChild ( ScopeChildren & Scope,
EnumInfo Info )
static

Definition at line 502 of file Serialize.cpp.

References clang::doc::ScopeChildren::Enums.

◆ InsertChild() [5/7]

void clang::doc::serialize::InsertChild ( ScopeChildren & Scope,
FunctionInfo Info )
static

Definition at line 506 of file Serialize.cpp.

References clang::doc::ScopeChildren::Functions.

◆ InsertChild() [6/7]

void clang::doc::serialize::InsertChild ( ScopeChildren & Scope,
TypedefInfo Info )
static

Definition at line 510 of file Serialize.cpp.

References clang::doc::ScopeChildren::Typedefs.

◆ InsertChild() [7/7]

void clang::doc::serialize::InsertChild ( ScopeChildren & Scope,
VarInfo Info )
static

Definition at line 518 of file Serialize.cpp.

References clang::doc::ScopeChildren::Variables.

◆ isPublic()

bool clang::doc::serialize::isPublic ( const clang::AccessSpecifier AS,
const clang::Linkage Link )
static

Definition at line 466 of file Serialize.cpp.

Referenced by shouldSerializeInfo().

◆ makeAndInsertIntoParent()

template<typename ChildType>
std::unique_ptr< Info > clang::doc::serialize::makeAndInsertIntoParent ( ChildType Child)
static

◆ parseBases() [1/2]

void clang::doc::serialize::parseBases ( RecordInfo & I,
const CXXRecordDecl * D )
static

◆ parseBases() [2/2]

void clang::doc::serialize::parseBases ( RecordInfo & I,
const CXXRecordDecl * D,
bool IsFileInRootDir,
bool PublicOnly,
bool IsParent,
AccessSpecifier ParentAccess = AccessSpecifier::AS_public )
static

◆ parseEnumerators()

void clang::doc::serialize::parseEnumerators ( EnumInfo & I,
const EnumDecl * D )
static

◆ parseFields()

void clang::doc::serialize::parseFields ( RecordInfo & I,
const RecordDecl * D,
bool PublicOnly,
AccessSpecifier Access = AccessSpecifier::AS_public )
static

Definition at line 601 of file Serialize.cpp.

References populateMemberTypeInfo(), PublicOnly(), and shouldSerializeInfo().

Referenced by emitInfo(), and parseBases().

◆ parseFriends()

◆ parseFullComment()

void clang::doc::serialize::parseFullComment ( const FullComment * C,
CommentInfo & CI )
static

◆ parseParameters()

void clang::doc::serialize::parseParameters ( FunctionInfo & I,
const FunctionDecl * D )
static

◆ populateConstraints()

void clang::doc::serialize::populateConstraints ( TemplateInfo & I,
const TemplateDecl * D )
static

◆ populateFunctionInfo()

◆ populateInfo()

template<typename T>
void clang::doc::serialize::populateInfo ( Info & I,
const T * D,
const FullComment * C,
bool & IsInAnonymousNamespace )
static

◆ populateMemberTypeInfo() [1/2]

void clang::doc::serialize::populateMemberTypeInfo ( MemberTypeInfo & I,
const Decl * D )
static

◆ populateMemberTypeInfo() [2/2]

void clang::doc::serialize::populateMemberTypeInfo ( RecordInfo & I,
AccessSpecifier & Access,
const DeclaratorDecl * D,
bool IsStatic = false )
static

◆ populateParentNamespaces()

template<typename T>
void clang::doc::serialize::populateParentNamespaces ( llvm::SmallVector< Reference, 4 > & Namespaces,
const T * D,
bool & IsAnonymousNamespace )
static

◆ populateSymbolInfo()

template<typename T>
void clang::doc::serialize::populateSymbolInfo ( SymbolInfo & I,
const T * D,
const FullComment * C,
Location Loc,
bool & IsInAnonymousNamespace )
static

◆ populateTemplateParameters()

void clang::doc::serialize::populateTemplateParameters ( std::optional< TemplateInfo > & TemplateInfo,
const clang::Decl * D )
static

Definition at line 722 of file Serialize.cpp.

References getSourceCode(), and clang::doc::TemplateInfo::Params.

Referenced by emitInfo(), and populateFunctionInfo().

◆ serialize() [1/2]

◆ serialize() [2/2]

template<typename T>
std::string clang::doc::serialize::serialize ( T & I)
static

Definition at line 387 of file Serialize.cpp.

References clang::doc::ClangDocBitcodeWriter::emitBlock(), and serialize().

Referenced by emitInfo(), serialize(), and serialize().

◆ shouldSerializeInfo()

bool clang::doc::serialize::shouldSerializeInfo ( bool PublicOnly,
bool IsInAnonymousNamespace,
const NamedDecl * D )
static