15#ifndef LLVM_CLANG_APINOTES_READER_H
16#define LLVM_CLANG_APINOTES_READER_H
19#include "llvm/Support/MemoryBuffer.h"
20#include "llvm/Support/VersionTuple.h"
33 llvm::VersionTuple SwiftVersion,
bool &Failed);
40 static std::unique_ptr<APINotesReader>
41 Create(std::unique_ptr<llvm::MemoryBuffer> InputBuffer,
42 llvm::VersionTuple SwiftVersion);
58 std::optional<unsigned> Selected;
67 llvm::VersionTuple Version,
71 std::optional<unsigned>
getSelected()
const {
return Selected; }
74 unsigned size()
const {
return Results.size(); }
77 const std::pair<llvm::VersionTuple, T> *
begin()
const {
78 assert(!Results.empty());
79 return Results.begin();
81 const std::pair<llvm::VersionTuple, T> *
end()
const {
86 const std::pair<llvm::VersionTuple, T> &
operator[](
unsigned index)
const {
87 assert(index < Results.size());
88 return Results[index];
129 VersionedInfo<ObjCPropertyInfo>
142 bool IsInstanceMethod);
159 llvm::StringRef Name);
166 VersionedInfo<GlobalVariableInfo>
168 std::optional<Context> Ctx = std::nullopt);
175 VersionedInfo<GlobalFunctionInfo>
177 std::optional<Context> Ctx = std::nullopt);
193 std::optional<ContextID>
195 std::optional<Context> ParentCtx = std::nullopt);
203 VersionedInfo<TagInfo>
lookupTag(llvm::StringRef Name,
204 std::optional<Context> Ctx = std::nullopt);
211 VersionedInfo<TypedefInfo>
213 std::optional<Context> Ctx = std::nullopt);
220 std::optional<ContextID>
222 std::optional<ContextID> ParentNamespaceID = std::nullopt);
Smart pointer class that efficiently represents Objective-C method names.
Captures the completed versioned information for a particular part of API notes, including both unver...
VersionedInfo(std::nullopt_t)
Form an empty set of versioned information.
const std::pair< llvm::VersionTuple, T > & operator[](unsigned index) const
Access a specific versioned result.
const std::pair< llvm::VersionTuple, T > * end() const
unsigned size() const
Return the number of versioned results we know about.
std::optional< unsigned > getSelected() const
Retrieve the selected index in the result set.
const std::pair< llvm::VersionTuple, T > * begin() const
Access all versioned results.
A class that reads API notes data from a binary file that was written by the APINotesWriter.
VersionedInfo< ContextInfo > lookupObjCClassInfo(llvm::StringRef Name)
Look for information regarding the given Objective-C class.
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< TagInfo > lookupTag(llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
Look for information regarding the given tag (struct/union/enum/C++ class).
VersionedInfo< GlobalFunctionInfo > lookupGlobalFunction(llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
Look for information regarding the given global function.
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< GlobalVariableInfo > lookupGlobalVariable(llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
Look for information regarding the given global variable.
std::optional< ContextID > lookupNamespaceID(llvm::StringRef Name, std::optional< ContextID > ParentNamespaceID=std::nullopt)
Look for the context ID of the given C++ namespace.
std::optional< ContextID > lookupTagID(llvm::StringRef Name, std::optional< Context > ParentCtx=std::nullopt)
Look for the context ID of the given C++ tag.
VersionedInfo< TypedefInfo > lookupTypedef(llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
Look for information regarding the given typedef.
std::optional< ContextID > lookupObjCClassID(llvm::StringRef Name)
Look for the context ID of the given Objective-C class.
APINotesReader & operator=(const APINotesReader &)=delete
VersionedInfo< ContextInfo > lookupObjCProtocolInfo(llvm::StringRef Name)
Look for information regarding the given Objective-C protocol.
std::optional< ContextID > lookupObjCProtocolID(llvm::StringRef Name)
Look for the context ID of the given Objective-C protocol.
VersionedInfo< EnumConstantInfo > lookupEnumConstant(llvm::StringRef Name)
Look for information regarding the given enumerator.
APINotesReader(const APINotesReader &)=delete
Opaque context ID used to refer to an Objective-C class or protocol or a C++ namespace.
The JSON file list parser is used to communicate input to InstallAPI.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
A temporary reference to an Objective-C selector, suitable for referencing selector data on the stack...