clang 19.0.0git
Classes | Public Member Functions | List of all members
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 addObjCContext (std::optional< ContextID > ParentCtxID, llvm::StringRef Name, ContextKind Kind, const ObjCContextInfo &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 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 1257 of file APINotesWriter.cpp.

◆ ~APINotesWriter()

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

◆ APINotesWriter() [2/2]

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

Member Function Documentation

◆ 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 1368 of file APINotesWriter.cpp.

◆ 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 1359 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 1350 of file APINotesWriter.cpp.

◆ addObjCContext()

ContextID clang::api_notes::APINotesWriter::addObjCContext ( std::optional< ContextID ParentCtxID,
llvm::StringRef  Name,
ContextKind  Kind,
const ObjCContextInfo 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 1266 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 1315 of file APINotesWriter.cpp.

References clang::api_notes::ObjCMethodInfo::DesignatedInit, 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 1305 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 1375 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 1382 of file APINotesWriter.cpp.

◆ operator=()

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

◆ writeToStream()

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

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