MLIR  16.0.0git
Macros | Functions
BytecodeReader.cpp File Reference
#include "mlir/Bytecode/BytecodeReader.h"
#include "../Encoding.h"
#include "mlir/AsmParser/AsmParser.h"
#include "mlir/Bytecode/BytecodeImplementation.h"
#include "mlir/IR/BuiltinDialect.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/Verifier.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/MemoryBufferRef.h"
#include "llvm/Support/SaveAndRestore.h"
+ Include dependency graph for BytecodeReader.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "mlir-bytecode-reader"
 

Functions

static std::string toString (bytecode::Section::ID sectionID)
 Stringify the given section ID. More...
 
static bool isSectionOptional (bytecode::Section::ID sectionID)
 Returns true if the given top-level section ID is optional. More...
 
template<typename RangeT , typename T >
static LogicalResult resolveEntry (EncodingReader &reader, RangeT &entries, uint64_t index, T &entry, StringRef entryStr)
 Resolve an index into the given entry list. More...
 
template<typename RangeT , typename T >
static LogicalResult parseEntry (EncodingReader &reader, RangeT &entries, T &entry, StringRef entryStr)
 Parse and resolve an index into the given entry list. More...
 
static LogicalResult parseDialectGrouping (EncodingReader &reader, MutableArrayRef< BytecodeDialect > dialects, function_ref< LogicalResult(BytecodeDialect *)> entryCallback)
 Parse a single dialect group encoded in the byte stream. More...
 
template<typename T >
static LogicalResult parseResourceGroup (Location fileLoc, bool allowEmpty, EncodingReader &offsetReader, EncodingReader &resourceReader, StringSectionReader &stringReader, T *handler, function_ref< LogicalResult(StringRef)> processKeyFn={})
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "mlir-bytecode-reader"

Definition at line 27 of file BytecodeReader.cpp.

Function Documentation

◆ isSectionOptional()

static bool isSectionOptional ( bytecode::Section::ID  sectionID)
static

◆ parseDialectGrouping()

static LogicalResult parseDialectGrouping ( EncodingReader &  reader,
MutableArrayRef< BytecodeDialect >  dialects,
function_ref< LogicalResult(BytecodeDialect *)>  entryCallback 
)
static

Parse a single dialect group encoded in the byte stream.

Definition at line 467 of file BytecodeReader.cpp.

References mlir::failed(), mlir::failure(), parseEntry(), and mlir::success().

◆ parseEntry()

template<typename RangeT , typename T >
static LogicalResult parseEntry ( EncodingReader &  reader,
RangeT &  entries,
T &  entry,
StringRef  entryStr 
)
static

Parse and resolve an index into the given entry list.

Definition at line 326 of file BytecodeReader.cpp.

References mlir::failed(), mlir::failure(), and resolveEntry().

Referenced by parseDialectGrouping().

◆ parseResourceGroup()

template<typename T >
static LogicalResult parseResourceGroup ( Location  fileLoc,
bool  allowEmpty,
EncodingReader &  offsetReader,
EncodingReader &  resourceReader,
StringSectionReader &  stringReader,
T *  handler,
function_ref< LogicalResult(StringRef)>  processKeyFn = {} 
)
static

Definition at line 578 of file BytecodeReader.cpp.

◆ resolveEntry()

template<typename RangeT , typename T >
static LogicalResult resolveEntry ( EncodingReader &  reader,
RangeT &  entries,
uint64_t  index,
T &  entry,
StringRef  entryStr 
)
static

Resolve an index into the given entry list.

entry may either be a reference, in which case it is assigned to the corresponding value in entries, or a pointer, in which case it is assigned to the address of the element in entries.

Definition at line 310 of file BytecodeReader.cpp.

References mlir::success().

Referenced by parseEntry().

◆ toString()

static std::string toString ( bytecode::Section::ID  sectionID)
static