clang-tools 19.0.0git
Classes | Functions
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 FieldDecl *D)
 
llvm::SmallString< 128 > getInfoRelativePath (const llvm::SmallVectorImpl< doc::Reference > &Namespaces)
 
llvm::SmallString< 128 > getInfoRelativePath (const Decl *D)
 
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< 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)
 
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 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)
 
std::pair< std::unique_ptr< Info >, std::unique_ptr< Info > > emitInfo (const NamespaceDecl *D, const FullComment *FC, int LineNumber, 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, 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, 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, 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, StringRef File, bool IsFileInRootDir, bool PublicOnly)
 

Function Documentation

◆ emitInfo() [1/12]

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

◆ emitInfo() [2/12]

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

References serialize().

◆ emitInfo() [3/12]

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

◆ emitInfo() [4/12]

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

◆ emitInfo() [5/12]

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

◆ emitInfo() [6/12]

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

◆ emitInfo() [7/12]

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

◆ emitInfo() [8/12]

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

◆ emitInfo() [9/12]

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

◆ emitInfo() [10/12]

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

◆ emitInfo() [11/12]

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

◆ emitInfo() [12/12]

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

◆ getFinalAccessSpecifier()

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

Definition at line 360 of file Serialize.cpp.

Referenced by parseBases(), and parseFields().

◆ getInfoRelativePath() [1/2]

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

Definition at line 56 of file Serialize.cpp.

References getInfoRelativePath(), and populateParentNamespaces().

◆ getInfoRelativePath() [2/2]

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

Definition at line 49 of file Serialize.cpp.

References E, and Path.

Referenced by emitInfo(), getInfoRelativePath(), getTypeInfoForType(), InsertChild(), and parseBases().

◆ getRecordDeclForType()

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

Definition at line 233 of file Serialize.cpp.

Referenced by parseBases().

◆ getSourceCode()

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

◆ getTagDeclForType()

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

Definition at line 227 of file Serialize.cpp.

Referenced by getTypeInfoForType().

◆ getTypeInfoForType()

TypeInfo clang::doc::serialize::getTypeInfoForType ( const QualType &  T)

◆ getUSRForDecl()

static SymbolID clang::doc::serialize::getUSRForDecl ( const Decl D)
static

◆ hashUSR()

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

Definition at line 24 of file Serialize.cpp.

References USR.

Referenced by getUSRForDecl().

◆ InsertChild() [1/5]

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

◆ InsertChild() [2/5]

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

◆ InsertChild() [3/5]

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

Definition at line 292 of file Serialize.cpp.

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

◆ InsertChild() [4/5]

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

Definition at line 296 of file Serialize.cpp.

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

◆ InsertChild() [5/5]

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

Definition at line 300 of file Serialize.cpp.

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

◆ isPublic()

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

Definition at line 256 of file Serialize.cpp.

Referenced by shouldSerializeInfo().

◆ MakeAndInsertIntoParent()

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

Definition at line 319 of file Serialize.cpp.

References InsertChild(), clang::doc::IT_namespace, and clang::doc::IT_record.

◆ parseBases() [1/2]

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

◆ parseBases() [2/2]

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

◆ parseEnumerators()

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

Definition at line 392 of file Serialize.cpp.

References E, getSourceCode(), and clang::doc::EnumInfo::Members.

Referenced by emitInfo().

◆ parseFields()

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

◆ parseFullComment()

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

◆ parseParameters()

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

◆ populateFunctionInfo()

static void clang::doc::serialize::populateFunctionInfo ( FunctionInfo I,
const FunctionDecl *  D,
const FullComment *  FC,
int  LineNumber,
StringRef  Filename,
bool  IsFileInRootDir,
bool &  IsInAnonymousNamespace 
)
static

◆ populateInfo()

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

◆ populateMemberTypeInfo()

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

Definition at line 558 of file Serialize.cpp.

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

Referenced by parseFields().

◆ populateParentNamespaces()

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

◆ populateSymbolInfo()

template<typename T >
static void clang::doc::serialize::populateSymbolInfo ( SymbolInfo I,
const T *  D,
const FullComment *  C,
int  LineNumber,
StringRef  Filename,
bool  IsFileInRootDir,
bool &  IsInAnonymousNamespace 
)
static

◆ PopulateTemplateParameters()

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

Definition at line 480 of file Serialize.cpp.

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

Referenced by emitInfo(), and populateFunctionInfo().

◆ serialize() [1/2]

std::string clang::doc::serialize::serialize ( std::unique_ptr< Info > &  I)

◆ serialize() [2/2]

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

Definition at line 192 of file Serialize.cpp.

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

Referenced by serialize().

◆ shouldSerializeInfo()

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

Definition at line 266 of file Serialize.cpp.

References isPublic(), and PublicOnly().

Referenced by emitInfo(), and parseFields().

◆ TemplateArgumentToInfo()

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

Definition at line 494 of file Serialize.cpp.

Referenced by emitInfo(), and populateFunctionInfo().