clang  6.0.0svn
Public Member Functions | 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 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...
 

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.

Definition at line 63 of file ModuleFileExtension.h.

Constructor & Destructor Documentation

◆ ~ModuleFileExtension()

ModuleFileExtension::~ModuleFileExtension ( )
virtual

Definition at line 13 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.

Implemented in clang::TestModuleFileExtension.

◆ 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.

Implemented in clang::TestModuleFileExtension.

◆ getExtensionMetadata()

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

Retrieves the metadata for this module file extension.

Implemented in clang::TestModuleFileExtension.

◆ 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.

Reimplemented in clang::TestModuleFileExtension.

Definition at line 15 of file ModuleFileExtension.cpp.


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