clang  13.0.0git
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]
Collaboration diagram for clang::ModuleFileExtension:
Collaboration graph
[legend]

Public Member Functions

virtual ~ModuleFileExtension ()
 
virtual ModuleFileExtensionMetadata getExtensionMetadata () const =0
 Retrieves the metadata for this module file extension. More...
 
virtual llvm::hash_code hashExtension (llvm::hash_code c) const
 Hash information about the presence of this extension into the module hash code. More...
 
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. More...
 
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. More...
 

Static Public Attributes

static char ID = 0
 Discriminator for LLVM RTTI. More...
 

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.

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()

llvm::hash_code ModuleFileExtension::hashExtension ( llvm::hash_code  c) const
virtual

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

The module hash code 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 code.

The default implementation of this function simply returns the hash code as given, so the presence/absence of this extension does not distinguish module files.

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: