clang 20.0.0git
Public Types | Public Member Functions | Static Public Attributes | List of all members
clang::ModuleFileExtension Class Referenceabstract

An abstract superclass that describes a custom extension to the module/precompiled header file format. More...

#include "clang/Serialization/ModuleFileExtension.h"

Inheritance diagram for clang::ModuleFileExtension:
Inheritance graph
[legend]

Public Types

using ExtensionHashBuilder = llvm::HashBuilder< llvm::MD5, llvm::endianness::native >
 Hash information about the presence of this extension into the module hash.
 

Public Member Functions

virtual ~ModuleFileExtension ()
 
virtual ModuleFileExtensionMetadata getExtensionMetadata () const =0
 Retrieves the metadata for this module file extension.
 
virtual void hashExtension (ExtensionHashBuilder &HBuilder) const
 
virtual std::unique_ptr< ModuleFileExtensionWritercreateExtensionWriter (ASTWriter &Writer)=0
 Create a new module file extension writer, which will be responsible for writing the extension contents into a particular module file.
 
virtual std::unique_ptr< ModuleFileExtensionReadercreateExtensionReader (const ModuleFileExtensionMetadata &Metadata, ASTReader &Reader, serialization::ModuleFile &Mod, const llvm::BitstreamCursor &Stream)=0
 Create a new module file extension reader, given the metadata read from the block and the cursor into the extension block.
 

Static Public Attributes

static char ID = 0
 Discriminator for LLVM RTTI.
 

Detailed Description

An abstract superclass that describes a custom extension to the module/precompiled header file format.

A module file extension can introduce additional information into compiled module files (.pcm) and precompiled headers (.pch) via a custom writer that can then be accessed via a custom reader when the module file or precompiled header is loaded.

Subclasses must use LLVM RTTI for open class hierarchies.

Definition at line 65 of file ModuleFileExtension.h.

Member Typedef Documentation

◆ ExtensionHashBuilder

using clang::ModuleFileExtension::ExtensionHashBuilder = llvm::HashBuilder<llvm::MD5, llvm::endianness::native>

Hash information about the presence of this extension into the module hash.

The module hash is used to distinguish different variants of a module that are incompatible. If the presence, absence, or version of the module file extension should force the creation of a separate set of module files, override this method to combine that distinguishing information into the module hash.

The default implementation of this function simply does nothing, so the presence/absence of this extension does not distinguish module files.

Definition at line 87 of file ModuleFileExtension.h.

Constructor & Destructor Documentation

◆ ~ModuleFileExtension()

ModuleFileExtension::~ModuleFileExtension ( )
virtual

Definition at line 14 of file ModuleFileExtension.cpp.

Member Function Documentation

◆ createExtensionReader()

virtual std::unique_ptr< ModuleFileExtensionReader > clang::ModuleFileExtension::createExtensionReader ( const ModuleFileExtensionMetadata Metadata,
ASTReader Reader,
serialization::ModuleFile Mod,
const llvm::BitstreamCursor &  Stream 
)
pure virtual

Create a new module file extension reader, given the metadata read from the block and the cursor into the extension block.

May return null to indicate that an extension block with the given metadata cannot be read.

◆ createExtensionWriter()

virtual std::unique_ptr< ModuleFileExtensionWriter > clang::ModuleFileExtension::createExtensionWriter ( ASTWriter Writer)
pure virtual

Create a new module file extension writer, which will be responsible for writing the extension contents into a particular module file.

◆ getExtensionMetadata()

virtual ModuleFileExtensionMetadata clang::ModuleFileExtension::getExtensionMetadata ( ) const
pure virtual

Retrieves the metadata for this module file extension.

◆ hashExtension()

void ModuleFileExtension::hashExtension ( ExtensionHashBuilder HBuilder) const
virtual

Definition at line 16 of file ModuleFileExtension.cpp.

Member Data Documentation

◆ ID

char ModuleFileExtension::ID = 0
static

Discriminator for LLVM RTTI.

Definition at line 69 of file ModuleFileExtension.h.


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