|
clang 24.0.0git
|
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 | |
| APINotesReader & | operator= (const APINotesReader &)=delete |
| std::optional< ContextID > | lookupObjCClassID (llvm::StringRef Name) |
| Look for the context ID of the given Objective-C class. | |
| VersionedInfo< ContextInfo > | lookupObjCClassInfo (llvm::StringRef Name) |
| Look for information regarding the given Objective-C class. | |
| std::optional< ContextID > | lookupObjCProtocolID (llvm::StringRef Name) |
| Look for the context ID of the given Objective-C protocol. | |
| VersionedInfo< ContextInfo > | lookupObjCProtocolInfo (llvm::StringRef Name) |
| Look for information regarding the given Objective-C protocol. | |
| VersionedInfo< ObjCPropertyInfo > | lookupObjCProperty (ContextID CtxID, llvm::StringRef Name, bool IsInstance) |
| Look for information regarding the given Objective-C property in the given context. | |
| VersionedInfo< ObjCMethodInfo > | lookupObjCMethod (ContextID CtxID, ObjCSelectorRef Selector, bool IsInstanceMethod) |
| Look for information regarding the given Objective-C method in the given context. | |
| VersionedInfo< FieldInfo > | lookupField (ContextID CtxID, llvm::StringRef Name) |
| Look for information regarding the given field of a C struct. | |
| VersionedInfo< CXXMethodInfo > | lookupCXXMethod (ContextID CtxID, llvm::StringRef Name) |
| Look for information regarding the given C++ method in the given C++ tag context. | |
| VersionedInfo< CXXMethodInfo > | lookupCXXMethod (ContextID CtxID, llvm::StringRef Name, llvm::ArrayRef< std::string > Parameters) |
| Look for information regarding the given C++ method with an exact parameter selector. | |
| std::optional< APINotesFunctionSelectorKey > | getCXXMethodSelectorKey (ContextID CtxID, llvm::StringRef Name) |
| Build the selector key for the given C++ method. | |
| std::optional< APINotesFunctionSelectorKey > | getCXXMethodSelectorKey (ContextID CtxID, llvm::StringRef Name, llvm::ArrayRef< std::string > Parameters) |
| Build the selector key for the given C++ method with an exact parameter selector. | |
| VersionedInfo< GlobalVariableInfo > | lookupGlobalVariable (llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt) |
| Look for information regarding the given global variable. | |
| VersionedInfo< GlobalFunctionInfo > | lookupGlobalFunction (llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt) |
| Look for information regarding the given global function. | |
| VersionedInfo< GlobalFunctionInfo > | lookupGlobalFunction (llvm::StringRef Name, llvm::ArrayRef< std::string > Parameters, std::optional< Context > Ctx=std::nullopt) |
| Look for information regarding the given global function with an exact parameter selector. | |
| std::optional< APINotesFunctionSelectorKey > | getGlobalFunctionSelectorKey (llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt) |
| Build the selector key for the given global function. | |
| std::optional< APINotesFunctionSelectorKey > | getGlobalFunctionSelectorKey (llvm::StringRef Name, llvm::ArrayRef< std::string > Parameters, std::optional< Context > Ctx=std::nullopt) |
| Build the selector key for the given global function with an exact parameter selector. | |
| void | collectExactFunctionParameterSelectors (llvm::SmallVectorImpl< APINotesFunctionSelectorKey > &Selectors) |
| Collect exact parameter selector keys stored by this reader. | |
| std::optional< llvm::SmallVector< std::string, 4 > > | getParameterSelectorSpellingsForDiagnostics (const APINotesFunctionSelectorKey &Key) |
| Reconstruct parameter selector strings for a stored exact selector key. | |
| VersionedInfo< EnumConstantInfo > | lookupEnumConstant (llvm::StringRef Name) |
| Look for information regarding the given enumerator. | |
| std::optional< ContextID > | lookupTagID (llvm::StringRef Name, std::optional< Context > ParentCtx=std::nullopt) |
| Look for the context ID of the given C++ tag. | |
| VersionedInfo< TagInfo > | lookupTag (llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt) |
| Look for information regarding the given tag (struct/union/enum/C++ class). | |
| VersionedInfo< TypedefInfo > | lookupTypedef (llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt) |
| Look for information regarding the given typedef. | |
| std::optional< ContextID > | lookupNamespaceID (llvm::StringRef Name, std::optional< ContextID > ParentNamespaceID=std::nullopt) |
| Look for the context ID of the given C++ namespace. | |
| template<typename ParameterT> | |
| auto | lookupCXXMethodImpl (ContextID CtxID, llvm::StringRef Name, llvm::ArrayRef< ParameterT > Parameters) -> VersionedInfo< CXXMethodInfo > |
| template<typename ParameterT> | |
| auto | lookupGlobalFunctionImpl (llvm::StringRef Name, llvm::ArrayRef< ParameterT > Parameters, std::optional< Context > Ctx) -> VersionedInfo< GlobalFunctionInfo > |
Static Public Member Functions | |
| static llvm::Expected< std::unique_ptr< APINotesReader > > | Create (std::unique_ptr< llvm::MemoryBuffer > InputBuffer, llvm::VersionTuple SwiftVersion) |
| Create a new API notes reader from the given memory buffer, which contains the contents of a binary API notes file. | |
A class that reads API notes data from a binary file that was written by the APINotesWriter.
Definition at line 33 of file APINotesReader.h.
| clang::api_notes::APINotesReader::~APINotesReader | ( | ) |
Definition at line 2232 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::InputBuffer.
|
delete |
| void clang::api_notes::APINotesReader::collectExactFunctionParameterSelectors | ( | llvm::SmallVectorImpl< APINotesFunctionSelectorKey > & | Selectors | ) |
Collect exact parameter selector keys stored by this reader.
Definition at line 2528 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::collectExactFunctionParameterSelectors(), clang::api_notes::APINotesReader::Implementation::CXXMethodTable, and clang::api_notes::APINotesReader::Implementation::GlobalFunctionTable.
Referenced by clang::APINotesSelectorDiagnosticState::getOrCreateReaderState().
|
static |
Create a new API notes reader from the given memory buffer, which contains the contents of a binary API notes file.
Definition at line 2235 of file APINotesReader.cpp.
| std::optional< APINotesFunctionSelectorKey > clang::api_notes::APINotesReader::getCXXMethodSelectorKey | ( | ContextID | CtxID, |
| llvm::StringRef | Name ) |
Build the selector key for the given C++ method.
Definition at line 2421 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::getFunctionKey(), and clang::api_notes::ContextID::Value.
| std::optional< APINotesFunctionSelectorKey > clang::api_notes::APINotesReader::getCXXMethodSelectorKey | ( | ContextID | CtxID, |
| llvm::StringRef | Name, | ||
| llvm::ArrayRef< std::string > | Parameters ) |
Build the selector key for the given C++ method with an exact parameter selector.
Definition at line 2430 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::getFunctionKey(), and clang::api_notes::ContextID::Value.
| std::optional< APINotesFunctionSelectorKey > clang::api_notes::APINotesReader::getGlobalFunctionSelectorKey | ( | llvm::StringRef | Name, |
| llvm::ArrayRef< std::string > | Parameters, | ||
| std::optional< Context > | Ctx = std::nullopt ) |
Build the selector key for the given global function with an exact parameter selector.
Definition at line 2518 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::getFunctionKey().
| std::optional< APINotesFunctionSelectorKey > clang::api_notes::APINotesReader::getGlobalFunctionSelectorKey | ( | llvm::StringRef | Name, |
| std::optional< Context > | Ctx = std::nullopt ) |
Build the selector key for the given global function.
Definition at line 2508 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::getFunctionKey().
| std::optional< llvm::SmallVector< std::string, 4 > > clang::api_notes::APINotesReader::getParameterSelectorSpellingsForDiagnostics | ( | const APINotesFunctionSelectorKey & | Key | ) |
Reconstruct parameter selector strings for a stored exact selector key.
Definition at line 2539 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::getIdentifierString(), clang::api_notes::APINotesFunctionSelectorKey::Key, and clang::api_notes::FunctionTableKey::parameterTypeIDs.
Referenced by clang::APINotesSelectorDiagnosticReaderState::diagnoseUnused().
| 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.
| CtxID | The ID that references the parent context, i.e. a C++ tag. |
| Name | The name of the C++ method we're looking for. |
Definition at line 2409 of file APINotesReader.cpp.
| auto clang::api_notes::APINotesReader::lookupCXXMethod | ( | ContextID | CtxID, |
| llvm::StringRef | Name, | ||
| llvm::ArrayRef< std::string > | Parameters ) |
Look for information regarding the given C++ method with an exact parameter selector.
An empty parameter list uses an exact zero-parameter key, and a non-empty list uses an exact ordered parameter key.
Definition at line 2414 of file APINotesReader.cpp.
| auto clang::api_notes::APINotesReader::lookupCXXMethodImpl | ( | ContextID | CtxID, |
| llvm::StringRef | Name, | ||
| llvm::ArrayRef< ParameterT > | Parameters ) -> VersionedInfo<CXXMethodInfo> |
| auto clang::api_notes::APINotesReader::lookupEnumConstant | ( | llvm::StringRef | Name | ) |
Look for information regarding the given enumerator.
| Name | The name of the enumerator. |
Definition at line 2593 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::EnumConstantTable, clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::api_notes::APINotesReader::Implementation::SwiftVersion.
| auto clang::api_notes::APINotesReader::lookupField | ( | ContextID | CtxID, |
| llvm::StringRef | Name ) |
Look for information regarding the given field of a C struct.
| Name | The name of the field. |
Definition at line 2392 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::FieldTable, clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::api_notes::APINotesReader::Implementation::SwiftVersion.
| auto clang::api_notes::APINotesReader::lookupGlobalFunction | ( | llvm::StringRef | Name, |
| llvm::ArrayRef< std::string > | Parameters, | ||
| std::optional< Context > | Ctx = std::nullopt ) |
Look for information regarding the given global function with an exact parameter selector.
An empty parameter list uses an exact zero-parameter key, and a non-empty list uses an exact ordered parameter key.
Definition at line 2501 of file APINotesReader.cpp.
| auto clang::api_notes::APINotesReader::lookupGlobalFunction | ( | llvm::StringRef | Name, |
| std::optional< Context > | Ctx = std::nullopt ) |
Look for information regarding the given global function.
| Name | The name of the global function. |
Definition at line 2495 of file APINotesReader.cpp.
| auto clang::api_notes::APINotesReader::lookupGlobalFunctionImpl | ( | llvm::StringRef | Name, |
| llvm::ArrayRef< ParameterT > | Parameters, | ||
| std::optional< Context > | Ctx ) -> VersionedInfo<GlobalFunctionInfo> |
| auto clang::api_notes::APINotesReader::lookupGlobalVariable | ( | llvm::StringRef | Name, |
| std::optional< Context > | Ctx = std::nullopt ) |
Look for information regarding the given global variable.
| Name | The name of the global variable. |
Definition at line 2476 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::getIdentifier(), clang::api_notes::APINotesReader::Implementation::GlobalVariableTable, and clang::api_notes::APINotesReader::Implementation::SwiftVersion.
| 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.
| Name | The name of the class we're looking for. |
Definition at line 2664 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::ContextIDTable, clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::api_notes::Namespace.
| auto clang::api_notes::APINotesReader::lookupObjCClassID | ( | llvm::StringRef | Name | ) |
Look for the context ID of the given Objective-C class.
| Name | The name of the class we're looking for. |
Definition at line 2285 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().
| auto clang::api_notes::APINotesReader::lookupObjCClassInfo | ( | llvm::StringRef | Name | ) |
Look for information regarding the given Objective-C class.
| Name | The name of the class we're looking for. |
Definition at line 2304 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::ContextInfoTable, lookupObjCClassID(), and clang::api_notes::APINotesReader::Implementation::SwiftVersion.
| 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.
| CtxID | The ID that references the context we are looking for. |
| Selector | The selector naming the method we're looking for. |
| IsInstanceMethod | Whether we are looking for an instance method. |
Definition at line 2373 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::getSelector(), clang::api_notes::APINotesReader::Implementation::ObjCMethodTable, and clang::api_notes::APINotesReader::Implementation::SwiftVersion.
| 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.
| CtxID | The ID that references the context we are looking for. |
| Name | The name of the property we're looking for. |
| IsInstance | Whether we are looking for an instance property (vs. a class property). |
Definition at line 2355 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::getIdentifier(), clang::api_notes::APINotesReader::Implementation::ObjCPropertyTable, and clang::api_notes::APINotesReader::Implementation::SwiftVersion.
| auto clang::api_notes::APINotesReader::lookupObjCProtocolID | ( | llvm::StringRef | Name | ) |
Look for the context ID of the given Objective-C protocol.
| Name | The name of the protocol we're looking for. |
Definition at line 2320 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().
| auto clang::api_notes::APINotesReader::lookupObjCProtocolInfo | ( | llvm::StringRef | Name | ) |
Look for information regarding the given Objective-C protocol.
| Name | The name of the protocol we're looking for. |
Definition at line 2339 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::ContextInfoTable, lookupObjCProtocolID(), and clang::api_notes::APINotesReader::Implementation::SwiftVersion.
| 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).
| Name | The name of the tag. |
Definition at line 2627 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::getIdentifier(), clang::api_notes::APINotesReader::Implementation::SwiftVersion, and clang::api_notes::APINotesReader::Implementation::TagTable.
| 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.
| Name | The name of the tag we're looking for. |
| ParentCtx | The context in which this tag is declared, e.g. a C++ namespace. |
Definition at line 2609 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::ContextIDTable, clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::api_notes::Tag.
| auto clang::api_notes::APINotesReader::lookupTypedef | ( | llvm::StringRef | Name, |
| std::optional< Context > | Ctx = std::nullopt ) |
Look for information regarding the given typedef.
| Name | The name of the typedef. |
Definition at line 2645 of file APINotesReader.cpp.
References clang::api_notes::APINotesReader::Implementation::getIdentifier(), clang::api_notes::APINotesReader::Implementation::SwiftVersion, and clang::api_notes::APINotesReader::Implementation::TypedefTable.
|
delete |