clang 19.0.0git
Classes | Public Member Functions | Public Attributes | List of all members
clang::extractapi::APISet Class Reference

APISet holds the set of API records collected from given inputs. More...

#include "clang/ExtractAPI/API.h"

Public Member Functions

const llvm::Triple & getTarget () const
 Get the target triple for the ExtractAPI invocation.
 
Language getLanguage () const
 Get the language used by the APIs.
 
APIRecordfindRecordForUSR (StringRef USR) const
 Finds the APIRecord for a given USR.
 
StringRef copyString (StringRef String)
 Copy String into the Allocator in this APISet.
 
SymbolReference createSymbolReference (StringRef Name, StringRef USR, StringRef Source="")
 
template<typename RecordTy , typename... CtorArgsContTy>
std::enable_if_t< std::is_base_of_v< APIRecord, RecordTy >, RecordTy > * createRecord (StringRef USR, StringRef Name, CtorArgsContTy &&...CtorArgs)
 Create a subclass of APIRecord and store it in the APISet.
 
ArrayRef< const APIRecord * > getTopLevelRecords () const
 
 APISet (const llvm::Triple &Target, Language Lang, const std::string &ProductName)
 
 APISet (const APISet &Other)=delete
 
APISetoperator= (const APISet &Other)=delete
 
 APISet (APISet &&Other)=delete
 
APISetoperator= (APISet &&Other)=delete
 

Public Attributes

const std::string ProductName
 

Detailed Description

APISet holds the set of API records collected from given inputs.

Definition at line 1350 of file API.h.

Constructor & Destructor Documentation

◆ APISet() [1/3]

clang::extractapi::APISet::APISet ( const llvm::Triple &  Target,
Language  Lang,
const std::string &  ProductName 
)
inline

Definition at line 1383 of file API.h.

◆ APISet() [2/3]

clang::extractapi::APISet::APISet ( const APISet Other)
delete

◆ APISet() [3/3]

clang::extractapi::APISet::APISet ( APISet &&  Other)
delete

Member Function Documentation

◆ copyString()

StringRef APISet::copyString ( StringRef  String)

Copy String into the Allocator in this APISet.

Returns
a StringRef of the copied string in APISet::Allocator.

Definition at line 79 of file API.cpp.

References memcpy().

Referenced by createRecord(), createSymbolReference(), and clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::getBases().

◆ createRecord()

template<typename RecordTy , typename... CtorArgsContTy>
std::enable_if_t< std::is_base_of_v< APIRecord, RecordTy >, RecordTy > * clang::extractapi::APISet::createRecord ( StringRef  USR,
StringRef  Name,
CtorArgsContTy &&...  CtorArgs 
)

Create a subclass of APIRecord and store it in the APISet.

Returns
A pointer to the created record or the already existing record matching this USR.

Definition at line 1417 of file API.h.

References copyString(), and clang::Result.

◆ createSymbolReference()

SymbolReference APISet::createSymbolReference ( StringRef  Name,
StringRef  USR,
StringRef  Source = "" 
)

◆ findRecordForUSR()

APIRecord * APISet::findRecordForUSR ( StringRef  USR) const

Finds the APIRecord for a given USR.

Returns
a pointer to the APIRecord associated with that USR or nullptr.

Definition at line 68 of file API.cpp.

Referenced by clang::extractapi::impl::ExtractAPIVisitorBase< Derived >::createSymbolReferenceForDecl(), and clang::extractapi::SymbolGraphSerializer::serializeSingleSymbolSGF().

◆ getLanguage()

Language clang::extractapi::APISet::getLanguage ( ) const
inline

Get the language used by the APIs.

Definition at line 1356 of file API.h.

Referenced by clang::extractapi::SymbolGraphSerializer::serializeSingleSymbolSGF().

◆ getTarget()

const llvm::Triple & clang::extractapi::APISet::getTarget ( ) const
inline

Get the target triple for the ExtractAPI invocation.

Definition at line 1353 of file API.h.

◆ getTopLevelRecords()

ArrayRef< const APIRecord * > clang::extractapi::APISet::getTopLevelRecords ( ) const
inline

Definition at line 1379 of file API.h.

Referenced by clang::extractapi::APISetVisitor< Derived >::traverseAPISet().

◆ operator=() [1/2]

APISet & clang::extractapi::APISet::operator= ( APISet &&  Other)
delete

◆ operator=() [2/2]

APISet & clang::extractapi::APISet::operator= ( const APISet Other)
delete

Member Data Documentation

◆ ProductName

const std::string clang::extractapi::APISet::ProductName

The documentation for this class was generated from the following files: