clang 20.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
clang::api_notes::APINotesReader Class Reference

A class that reads API notes data from a binary file that was written by the APINotesWriter. More...

#include "clang/APINotes/APINotesReader.h"

Classes

class  Implementation
 
class  VersionedInfo
 Captures the completed versioned information for a particular part of API notes, including both unversioned API notes and each versioned API note for that particular entity. More...
 

Public Member Functions

 ~APINotesReader ()
 
 APINotesReader (const APINotesReader &)=delete
 
APINotesReaderoperator= (const APINotesReader &)=delete
 
std::optional< ContextIDlookupObjCClassID (llvm::StringRef Name)
 Look for the context ID of the given Objective-C class.
 
VersionedInfo< ContextInfolookupObjCClassInfo (llvm::StringRef Name)
 Look for information regarding the given Objective-C class.
 
std::optional< ContextIDlookupObjCProtocolID (llvm::StringRef Name)
 Look for the context ID of the given Objective-C protocol.
 
VersionedInfo< ContextInfolookupObjCProtocolInfo (llvm::StringRef Name)
 Look for information regarding the given Objective-C protocol.
 
VersionedInfo< ObjCPropertyInfolookupObjCProperty (ContextID CtxID, llvm::StringRef Name, bool IsInstance)
 Look for information regarding the given Objective-C property in the given context.
 
VersionedInfo< ObjCMethodInfolookupObjCMethod (ContextID CtxID, ObjCSelectorRef Selector, bool IsInstanceMethod)
 Look for information regarding the given Objective-C method in the given context.
 
VersionedInfo< FieldInfolookupField (ContextID CtxID, llvm::StringRef Name)
 Look for information regarding the given field of a C struct.
 
VersionedInfo< CXXMethodInfolookupCXXMethod (ContextID CtxID, llvm::StringRef Name)
 Look for information regarding the given C++ method in the given C++ tag context.
 
VersionedInfo< GlobalVariableInfolookupGlobalVariable (llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
 Look for information regarding the given global variable.
 
VersionedInfo< GlobalFunctionInfolookupGlobalFunction (llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
 Look for information regarding the given global function.
 
VersionedInfo< EnumConstantInfolookupEnumConstant (llvm::StringRef Name)
 Look for information regarding the given enumerator.
 
std::optional< ContextIDlookupTagID (llvm::StringRef Name, std::optional< Context > ParentCtx=std::nullopt)
 Look for the context ID of the given C++ tag.
 
VersionedInfo< TagInfolookupTag (llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
 Look for information regarding the given tag (struct/union/enum/C++ class).
 
VersionedInfo< TypedefInfolookupTypedef (llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
 Look for information regarding the given typedef.
 
std::optional< ContextIDlookupNamespaceID (llvm::StringRef Name, std::optional< ContextID > ParentNamespaceID=std::nullopt)
 Look for the context ID of the given C++ namespace.
 

Static Public Member Functions

static std::unique_ptr< APINotesReaderCreate (std::unique_ptr< llvm::MemoryBuffer > InputBuffer, llvm::VersionTuple SwiftVersion)
 Create a new API notes reader from the given member buffer, which contains the contents of a binary API notes file.
 

Detailed Description

A class that reads API notes data from a binary file that was written by the APINotesWriter.

Definition at line 28 of file APINotesReader.h.

Constructor & Destructor Documentation

◆ ~APINotesReader()

clang::api_notes::APINotesReader::~APINotesReader ( )

◆ APINotesReader()

clang::api_notes::APINotesReader::APINotesReader ( const APINotesReader )
delete

Member Function Documentation

◆ Create()

std::unique_ptr< APINotesReader > clang::api_notes::APINotesReader::Create ( std::unique_ptr< llvm::MemoryBuffer >  InputBuffer,
llvm::VersionTuple  SwiftVersion 
)
static

Create a new API notes reader from the given member buffer, which contains the contents of a binary API notes file.

Returns
the new API notes reader, or null if an error occurred.

Definition at line 2026 of file APINotesReader.cpp.

◆ lookupCXXMethod()

auto clang::api_notes::APINotesReader::lookupCXXMethod ( ContextID  CtxID,
llvm::StringRef  Name 
)

Look for information regarding the given C++ method in the given C++ tag context.

Parameters
CtxIDThe ID that references the parent context, i.e. a C++ tag.
NameThe name of the C++ method we're looking for.
Returns
Information about the method, if known.

Definition at line 2199 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::CXXMethodTable, clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::api_notes::APINotesReader::Implementation::SwiftVersion.

◆ lookupEnumConstant()

auto clang::api_notes::APINotesReader::lookupEnumConstant ( llvm::StringRef  Name)

Look for information regarding the given enumerator.

Parameters
NameThe name of the enumerator.
Returns
information about the enumerator, if known.

Definition at line 2254 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::EnumConstantTable, clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::api_notes::APINotesReader::Implementation::SwiftVersion.

◆ lookupField()

auto clang::api_notes::APINotesReader::lookupField ( ContextID  CtxID,
llvm::StringRef  Name 
)

Look for information regarding the given field of a C struct.

Parameters
NameThe name of the field.
Returns
information about the field, if known.

Definition at line 2182 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::FieldTable, clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::api_notes::APINotesReader::Implementation::SwiftVersion.

◆ lookupGlobalFunction()

auto clang::api_notes::APINotesReader::lookupGlobalFunction ( llvm::StringRef  Name,
std::optional< Context Ctx = std::nullopt 
)

Look for information regarding the given global function.

Parameters
NameThe name of the global function.
Returns
information about the global function, if known.

Definition at line 2235 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::getIdentifier(), clang::api_notes::APINotesReader::Implementation::GlobalFunctionTable, and clang::api_notes::APINotesReader::Implementation::SwiftVersion.

◆ lookupGlobalVariable()

auto clang::api_notes::APINotesReader::lookupGlobalVariable ( llvm::StringRef  Name,
std::optional< Context Ctx = std::nullopt 
)

Look for information regarding the given global variable.

Parameters
NameThe name of the global variable.
Returns
information about the global variable, if known.

Definition at line 2216 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::getIdentifier(), clang::api_notes::APINotesReader::Implementation::GlobalVariableTable, and clang::api_notes::APINotesReader::Implementation::SwiftVersion.

◆ lookupNamespaceID()

auto clang::api_notes::APINotesReader::lookupNamespaceID ( llvm::StringRef  Name,
std::optional< ContextID ParentNamespaceID = std::nullopt 
)

Look for the context ID of the given C++ namespace.

Parameters
NameThe name of the class we're looking for.
Returns
The ID, if known.

Definition at line 2325 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::ContextIDTable, clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::api_notes::Namespace.

◆ lookupObjCClassID()

auto clang::api_notes::APINotesReader::lookupObjCClassID ( llvm::StringRef  Name)

Look for the context ID of the given Objective-C class.

Parameters
NameThe name of the class we're looking for.
Returns
The ID, if known.

Definition at line 2075 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::ContextIDTable, clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::api_notes::ObjCClass.

Referenced by lookupObjCClassInfo().

◆ lookupObjCClassInfo()

auto clang::api_notes::APINotesReader::lookupObjCClassInfo ( llvm::StringRef  Name)

Look for information regarding the given Objective-C class.

Parameters
NameThe name of the class we're looking for.
Returns
The information about the class, if known.

Definition at line 2094 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::ContextInfoTable, lookupObjCClassID(), and clang::api_notes::APINotesReader::Implementation::SwiftVersion.

◆ lookupObjCMethod()

auto clang::api_notes::APINotesReader::lookupObjCMethod ( ContextID  CtxID,
ObjCSelectorRef  Selector,
bool  IsInstanceMethod 
)

Look for information regarding the given Objective-C method in the given context.

Parameters
CtxIDThe ID that references the context we are looking for.
SelectorThe selector naming the method we're looking for.
IsInstanceMethodWhether we are looking for an instance method.
Returns
Information about the method, if known.

Definition at line 2163 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::getSelector(), clang::api_notes::APINotesReader::Implementation::ObjCMethodTable, and clang::api_notes::APINotesReader::Implementation::SwiftVersion.

◆ lookupObjCProperty()

auto clang::api_notes::APINotesReader::lookupObjCProperty ( ContextID  CtxID,
llvm::StringRef  Name,
bool  IsInstance 
)

Look for information regarding the given Objective-C property in the given context.

Parameters
CtxIDThe ID that references the context we are looking for.
NameThe name of the property we're looking for.
IsInstanceWhether we are looking for an instance property (vs. a class property).
Returns
Information about the property, if known.

Definition at line 2145 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::getIdentifier(), clang::api_notes::APINotesReader::Implementation::ObjCPropertyTable, and clang::api_notes::APINotesReader::Implementation::SwiftVersion.

◆ lookupObjCProtocolID()

auto clang::api_notes::APINotesReader::lookupObjCProtocolID ( llvm::StringRef  Name)

Look for the context ID of the given Objective-C protocol.

Parameters
NameThe name of the protocol we're looking for.
Returns
The ID of the protocol, if known.

Definition at line 2110 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::ContextIDTable, clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::api_notes::ObjCProtocol.

Referenced by lookupObjCProtocolInfo().

◆ lookupObjCProtocolInfo()

auto clang::api_notes::APINotesReader::lookupObjCProtocolInfo ( llvm::StringRef  Name)

Look for information regarding the given Objective-C protocol.

Parameters
NameThe name of the protocol we're looking for.
Returns
The information about the protocol, if known.

Definition at line 2129 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::ContextInfoTable, lookupObjCProtocolID(), and clang::api_notes::APINotesReader::Implementation::SwiftVersion.

◆ lookupTag()

auto clang::api_notes::APINotesReader::lookupTag ( llvm::StringRef  Name,
std::optional< Context Ctx = std::nullopt 
)

Look for information regarding the given tag (struct/union/enum/C++ class).

Parameters
NameThe name of the tag.
Returns
information about the tag, if known.

Definition at line 2288 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::getIdentifier(), clang::api_notes::APINotesReader::Implementation::SwiftVersion, and clang::api_notes::APINotesReader::Implementation::TagTable.

◆ lookupTagID()

auto clang::api_notes::APINotesReader::lookupTagID ( llvm::StringRef  Name,
std::optional< Context ParentCtx = std::nullopt 
)

Look for the context ID of the given C++ tag.

Parameters
NameThe name of the tag we're looking for.
ParentCtxThe context in which this tag is declared, e.g. a C++ namespace.
Returns
The ID, if known.

Definition at line 2270 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::ContextIDTable, clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::api_notes::Tag.

◆ lookupTypedef()

auto clang::api_notes::APINotesReader::lookupTypedef ( llvm::StringRef  Name,
std::optional< Context Ctx = std::nullopt 
)

Look for information regarding the given typedef.

Parameters
NameThe name of the typedef.
Returns
information about the typedef, if known.

Definition at line 2306 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::getIdentifier(), clang::api_notes::APINotesReader::Implementation::SwiftVersion, and clang::api_notes::APINotesReader::Implementation::TypedefTable.

◆ operator=()

APINotesReader & clang::api_notes::APINotesReader::operator= ( const APINotesReader )
delete

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