clang 22.0.0git
clang::api_notes::APINotesWriter Class Reference

A class that writes API notes data to a binary representation that can be read by the APINotesReader. More...

#include "clang/APINotes/APINotesWriter.h"

Classes

class  Implementation

Public Member Functions

 APINotesWriter (llvm::StringRef ModuleName, const FileEntry *SF)
 Create a new API notes writer with the given module name and (optional) source file.
 ~APINotesWriter ()
 APINotesWriter (const APINotesWriter &)=delete
APINotesWriteroperator= (const APINotesWriter &)=delete
void writeToStream (llvm::raw_ostream &OS)
ContextID addContext (std::optional< ContextID > ParentCtxID, llvm::StringRef Name, ContextKind Kind, const ContextInfo &Info, llvm::VersionTuple SwiftVersion)
 Add information about a specific Objective-C class or protocol or a C++ namespace.
void addObjCProperty (ContextID CtxID, llvm::StringRef Name, bool IsInstanceProperty, const ObjCPropertyInfo &Info, llvm::VersionTuple SwiftVersion)
 Add information about a specific Objective-C property.
void addObjCMethod (ContextID CtxID, ObjCSelectorRef Selector, bool IsInstanceMethod, const ObjCMethodInfo &Info, llvm::VersionTuple SwiftVersion)
 Add information about a specific Objective-C method.
void addCXXMethod (ContextID CtxID, llvm::StringRef Name, const CXXMethodInfo &Info, llvm::VersionTuple SwiftVersion)
 Add information about a specific C++ method.
void addField (ContextID CtxID, llvm::StringRef Name, const FieldInfo &Info, llvm::VersionTuple SwiftVersion)
 Add information about a specific C record field.
void addGlobalVariable (std::optional< Context > Ctx, llvm::StringRef Name, const GlobalVariableInfo &Info, llvm::VersionTuple SwiftVersion)
 Add information about a global variable.
void addGlobalFunction (std::optional< Context > Ctx, llvm::StringRef Name, const GlobalFunctionInfo &Info, llvm::VersionTuple SwiftVersion)
 Add information about a global function.
void addEnumConstant (llvm::StringRef Name, const EnumConstantInfo &Info, llvm::VersionTuple SwiftVersion)
 Add information about an enumerator.
void addTag (std::optional< Context > Ctx, llvm::StringRef Name, const TagInfo &Info, llvm::VersionTuple SwiftVersion)
 Add information about a tag (struct/union/enum/C++ class).
void addTypedef (std::optional< Context > Ctx, llvm::StringRef Name, const TypedefInfo &Info, llvm::VersionTuple SwiftVersion)
 Add information about a typedef.

Detailed Description

A class that writes API notes data to a binary representation that can be read by the APINotesReader.

Definition at line 32 of file APINotesWriter.h.

Constructor & Destructor Documentation

◆ APINotesWriter() [1/2]

clang::api_notes::APINotesWriter::APINotesWriter ( llvm::StringRef ModuleName,
const FileEntry * SF )

Create a new API notes writer with the given module name and (optional) source file.

Definition at line 1435 of file APINotesWriter.cpp.

Referenced by APINotesWriter(), and operator=().

◆ ~APINotesWriter()

clang::api_notes::APINotesWriter::~APINotesWriter ( )
default

◆ APINotesWriter() [2/2]

clang::api_notes::APINotesWriter::APINotesWriter ( const APINotesWriter & )
delete

References APINotesWriter().

Member Function Documentation

◆ addContext()

ContextID clang::api_notes::APINotesWriter::addContext ( std::optional< ContextID > ParentCtxID,
llvm::StringRef Name,
ContextKind Kind,
const ContextInfo & Info,
llvm::VersionTuple SwiftVersion )

Add information about a specific Objective-C class or protocol or a C++ namespace.

Parameters
NameThe name of this class/protocol/namespace.
KindWhether this is a class, a protocol, or a namespace.
InfoInformation about this class/protocol/namespace.
Returns
the ID of the class, protocol, or namespace, which can be used to add properties and methods to the class/protocol/namespace.

Definition at line 1444 of file APINotesWriter.cpp.

References clang::Found.

◆ addCXXMethod()

void clang::api_notes::APINotesWriter::addCXXMethod ( ContextID CtxID,
llvm::StringRef Name,
const CXXMethodInfo & Info,
llvm::VersionTuple SwiftVersion )

Add information about a specific C++ method.

Parameters
CtxIDThe context in which this method resides, i.e. a C++ tag.
NameThe name of the method.
InfoInformation about this method.

Definition at line 1528 of file APINotesWriter.cpp.

References clang::api_notes::ContextID::Value.

◆ addEnumConstant()

void clang::api_notes::APINotesWriter::addEnumConstant ( llvm::StringRef Name,
const EnumConstantInfo & Info,
llvm::VersionTuple SwiftVersion )

Add information about an enumerator.

Parameters
NameThe name of this enumerator.
InfoInformation about this enumerator.

Definition at line 1562 of file APINotesWriter.cpp.

◆ addField()

void clang::api_notes::APINotesWriter::addField ( ContextID CtxID,
llvm::StringRef Name,
const FieldInfo & Info,
llvm::VersionTuple SwiftVersion )

Add information about a specific C record field.

Parameters
CtxIDThe context in which this field resides, i.e. a C/C++ tag.
NameThe name of the field.
InfoInformation about this field.

Definition at line 1536 of file APINotesWriter.cpp.

References clang::api_notes::ContextID::Value.

◆ addGlobalFunction()

void clang::api_notes::APINotesWriter::addGlobalFunction ( std::optional< Context > Ctx,
llvm::StringRef Name,
const GlobalFunctionInfo & Info,
llvm::VersionTuple SwiftVersion )

Add information about a global function.

Parameters
NameThe name of this global function.
InfoInformation about this global function.

Definition at line 1553 of file APINotesWriter.cpp.

◆ addGlobalVariable()

void clang::api_notes::APINotesWriter::addGlobalVariable ( std::optional< Context > Ctx,
llvm::StringRef Name,
const GlobalVariableInfo & Info,
llvm::VersionTuple SwiftVersion )

Add information about a global variable.

Parameters
NameThe name of this global variable.
InfoInformation about this global variable.

Definition at line 1544 of file APINotesWriter.cpp.

◆ addObjCMethod()

void clang::api_notes::APINotesWriter::addObjCMethod ( ContextID CtxID,
ObjCSelectorRef Selector,
bool IsInstanceMethod,
const ObjCMethodInfo & Info,
llvm::VersionTuple SwiftVersion )

Add information about a specific Objective-C method.

Parameters
CtxIDThe context in which this method resides.
SelectorThe selector that names this method.
IsInstanceMethodWhether this method is an instance method (vs. a class method).
InfoInformation about this method.

Definition at line 1493 of file APINotesWriter.cpp.

References clang::api_notes::ObjCMethodInfo::DesignatedInit, clang::Found, clang::api_notes::ObjCClass, and clang::api_notes::ContextID::Value.

◆ addObjCProperty()

void clang::api_notes::APINotesWriter::addObjCProperty ( ContextID CtxID,
llvm::StringRef Name,
bool IsInstanceProperty,
const ObjCPropertyInfo & Info,
llvm::VersionTuple SwiftVersion )

Add information about a specific Objective-C property.

Parameters
CtxIDThe context in which this property resides.
NameThe name of this property.
InfoInformation about this property.

Definition at line 1483 of file APINotesWriter.cpp.

References clang::api_notes::ContextID::Value.

◆ addTag()

void clang::api_notes::APINotesWriter::addTag ( std::optional< Context > Ctx,
llvm::StringRef Name,
const TagInfo & Info,
llvm::VersionTuple SwiftVersion )

Add information about a tag (struct/union/enum/C++ class).

Parameters
NameThe name of this tag.
InfoInformation about this tag.

Definition at line 1569 of file APINotesWriter.cpp.

◆ addTypedef()

void clang::api_notes::APINotesWriter::addTypedef ( std::optional< Context > Ctx,
llvm::StringRef Name,
const TypedefInfo & Info,
llvm::VersionTuple SwiftVersion )

Add information about a typedef.

Parameters
NameThe name of this typedef.
InfoInformation about this typedef.

Definition at line 1576 of file APINotesWriter.cpp.

◆ operator=()

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

References APINotesWriter().

◆ writeToStream()

void clang::api_notes::APINotesWriter::writeToStream ( llvm::raw_ostream & OS)

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