LLVM  14.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
llvm::BCGenericRecordLayout< IDField, Fields > Class Template Reference

Represents a single bitcode record type. More...

#include "llvm/Bitcode/BitcodeConvenience.h"

Inheritance diagram for llvm::BCGenericRecordLayout< IDField, Fields >:
Inheritance graph
[legend]
Collaboration diagram for llvm::BCGenericRecordLayout< IDField, Fields >:
Collaboration graph
[legend]

Public Member Functions

 BCGenericRecordLayout (llvm::BitstreamWriter &Stream)
 Create a layout and register it with the given bitstream writer. More...
 
template<typename BufferTy , typename... Data>
void emit (BufferTy &buffer, unsigned id, Data &&...data) const
 Emit a record to the bitstream writer, using the given buffer for scratch space. More...
 

Static Public Member Functions

static unsigned emitAbbrev (llvm::BitstreamWriter &Stream)
 Registers this record's layout with the bitstream reader. More...
 
template<typename BufferTy , typename... Data>
static void emitRecord (llvm::BitstreamWriter &Stream, BufferTy &buffer, unsigned abbrCode, unsigned recordID, Data &&...data)
 Emit a record identified by abbrCode to bitstream reader Stream, using buffer for scratch space. More...
 
template<typename ElementTy , typename... Data>
static void readRecord (ArrayRef< ElementTy > buffer, Data &&...data)
 Extract record data from buffer into the given data fields. More...
 
template<typename BufferTy , typename... Data>
static void readRecord (BufferTy &buffer, Data &&...data)
 Extract record data from buffer into the given data fields. More...
 

Public Attributes

const unsigned AbbrevCode
 The abbreviation code used for this record in the current block. More...
 

Detailed Description

template<typename IDField, typename... Fields>
class llvm::BCGenericRecordLayout< IDField, Fields >

Represents a single bitcode record type.

This class template is meant to be instantiated and then given a name, so that from then on that name can be used.

Definition at line 356 of file BitcodeConvenience.h.

Constructor & Destructor Documentation

◆ BCGenericRecordLayout()

template<typename IDField , typename... Fields>
llvm::BCGenericRecordLayout< IDField, Fields >::BCGenericRecordLayout ( llvm::BitstreamWriter Stream)
inlineexplicit

Create a layout and register it with the given bitstream writer.

Definition at line 367 of file BitcodeConvenience.h.

Member Function Documentation

◆ emit()

template<typename IDField , typename... Fields>
template<typename BufferTy , typename... Data>
void llvm::BCGenericRecordLayout< IDField, Fields >::emit ( BufferTy &  buffer,
unsigned  id,
Data &&...  data 
) const
inline

Emit a record to the bitstream writer, using the given buffer for scratch space.

Note that even fixed arguments must be specified here.

Definition at line 375 of file BitcodeConvenience.h.

◆ emitAbbrev()

template<typename IDField , typename... Fields>
static unsigned llvm::BCGenericRecordLayout< IDField, Fields >::emitAbbrev ( llvm::BitstreamWriter Stream)
inlinestatic

Registers this record's layout with the bitstream reader.

eturns The abbreviation code for the newly-registered record type.

Definition at line 382 of file BitcodeConvenience.h.

◆ emitRecord()

template<typename IDField , typename... Fields>
template<typename BufferTy , typename... Data>
static void llvm::BCGenericRecordLayout< IDField, Fields >::emitRecord ( llvm::BitstreamWriter Stream,
BufferTy &  buffer,
unsigned  abbrCode,
unsigned  recordID,
Data &&...  data 
)
inlinestatic

Emit a record identified by abbrCode to bitstream reader Stream, using buffer for scratch space.

Note that even fixed arguments must be specified here. Blobs are passed as StringRefs, while arrays can be passed inline, as aggregates, or as pre-encoded StringRef data. Skipped values and empty arrays should use the special Nothing value.

Definition at line 396 of file BitcodeConvenience.h.

Referenced by llvm::BCGenericRecordLayout< BCLiteral< RecordCode >, Fields... >::emit().

◆ readRecord() [1/2]

template<typename IDField , typename... Fields>
template<typename ElementTy , typename... Data>
static void llvm::BCGenericRecordLayout< IDField, Fields >::readRecord ( ArrayRef< ElementTy >  buffer,
Data &&...  data 
)
inlinestatic

Extract record data from buffer into the given data fields.

Note that even fixed arguments must be specified here. Pass Nothing if you don't care about a particular parameter. Blob data is not included in the buffer and should be handled separately by the caller.

Definition at line 414 of file BitcodeConvenience.h.

Referenced by llvm::BCGenericRecordLayout< BCLiteral< RecordCode >, Fields... >::readRecord().

◆ readRecord() [2/2]

template<typename IDField , typename... Fields>
template<typename BufferTy , typename... Data>
static void llvm::BCGenericRecordLayout< IDField, Fields >::readRecord ( BufferTy &  buffer,
Data &&...  data 
)
inlinestatic

Extract record data from buffer into the given data fields.

Note that even fixed arguments must be specified here. Pass Nothing if you don't care about a particular parameter. Blob data is not included in the buffer and should be handled separately by the caller.

Definition at line 430 of file BitcodeConvenience.h.

Member Data Documentation

◆ AbbrevCode

template<typename IDField , typename... Fields>
const unsigned llvm::BCGenericRecordLayout< IDField, Fields >::AbbrevCode

The abbreviation code used for this record in the current block.

Note that this is not the same as the semantic record code, which is the first field of the record.

Definition at line 364 of file BitcodeConvenience.h.

Referenced by llvm::BCGenericRecordLayout< BCLiteral< RecordCode >, Fields... >::emit().


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