clang 19.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< ObjCContextInfolookupObjCClassInfo (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< ObjCContextInfolookupObjCProtocolInfo (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< 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.
 
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 1772 of file APINotesReader.cpp.

◆ 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 1961 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::EnumConstantTable, 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 1942 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 1923 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 2014 of file APINotesReader.cpp.

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

◆ 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 1816 of file APINotesReader.cpp.

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

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 1835 of file APINotesReader.cpp.

References lookupObjCClassID(), clang::api_notes::APINotesReader::Implementation::ObjCContextInfoTable, 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 1904 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 1886 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 1851 of file APINotesReader.cpp.

References clang::api_notes::APINotesReader::Implementation::getIdentifier(), clang::api_notes::APINotesReader::Implementation::ObjCContextIDTable, 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 1870 of file APINotesReader.cpp.

References lookupObjCProtocolID(), clang::api_notes::APINotesReader::Implementation::ObjCContextInfoTable, 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 1977 of file APINotesReader.cpp.

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

◆ 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 1995 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: