MLIR
21.0.0git
|
#include "mlir/Dialect/EmitC/IR/EmitC.h"
#include "mlir/Dialect/EmitC/IR/EmitCTraits.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/Types.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/FormatVariadic.h"
#include "mlir/Dialect/EmitC/IR/EmitCDialect.cpp.inc"
#include "mlir/Dialect/EmitC/IR/EmitC.cpp.inc"
#include "mlir/Dialect/EmitC/IR/EmitCTypes.cpp.inc"
#include "mlir/Dialect/EmitC/IR/EmitCAttributes.cpp.inc"
#include "mlir/Dialect/EmitC/IR/EmitCEnums.cpp.inc"
Go to the source code of this file.
Macros | |
#define | GET_OP_LIST |
#define | GET_TYPEDEF_LIST |
#define | GET_ATTRDEF_LIST |
#define | GET_ATTRDEF_CLASSES |
#define | GET_TYPEDEF_CLASSES |
#define | GET_OP_CLASSES |
Functions | |
static LogicalResult | verifyInitializationAttribute (Operation *op, Attribute value) |
Check that the type of the initial value is compatible with the operations result type. More... | |
template<class ArgType > | |
FailureOr< SmallVector< ReplacementItem > > | parseFormatString (StringRef toParse, ArgType fmtArgs, std::optional< llvm::function_ref< mlir::InFlightDiagnostic()>> emitError={}) |
Parse a format string and return a list of its parts. More... | |
static void | printEmitCGlobalOpTypeAndInitialValue (OpAsmPrinter &p, GlobalOp op, TypeAttr type, Attribute initialValue) |
static Type | getInitializerTypeForGlobal (Type type) |
static ParseResult | parseEmitCGlobalOpTypeAndInitialValue (OpAsmParser &parser, TypeAttr &typeAttr, Attribute &initialValue) |
static ParseResult | parseSwitchCases (OpAsmParser &parser, DenseI64ArrayAttr &cases, SmallVectorImpl< std::unique_ptr< Region >> &caseRegions) |
Parse the case regions and values. More... | |
static void | printSwitchCases (OpAsmPrinter &p, Operation *op, DenseI64ArrayAttr cases, RegionRange caseRegions) |
Print the case regions and values. More... | |
static LogicalResult | verifyRegion (emitc::SwitchOp op, Region ®ion, const Twine &name) |
#define GET_ATTRDEF_LIST |
#define GET_OP_LIST |
#define GET_TYPEDEF_LIST |
Definition at line 1151 of file EmitC.cpp.
References mlir::get().
Referenced by parseEmitCGlobalOpTypeAndInitialValue().
|
static |
Definition at line 1158 of file EmitC.cpp.
References mlir::AsmParser::emitError(), mlir::get(), getInitializerTypeForGlobal(), mlir::AsmParser::getNameLoc(), mlir::AsmParser::parseAttribute(), mlir::AsmParser::parseOptionalEqual(), and mlir::AsmParser::parseType().
FailureOr<SmallVector<ReplacementItem> > parseFormatString | ( | StringRef | toParse, |
ArgType | fmtArgs, | ||
std::optional< llvm::function_ref< mlir::InFlightDiagnostic()>> | emitError = {} |
||
) |
Parse a format string and return a list of its parts.
A part is either a StringRef that has to be printed as-is, or a Placeholder which requires printing the next operand of the VerbatimOp. In the format string, all {}
are replaced by Placeholders, except if the {
is escaped by {{
- then it doesn't start a placeholder.
Definition at line 178 of file EmitC.cpp.
Referenced by mlir::tblgen::FmtObjectBase::FmtObjectBase().
|
static |
Parse the case regions and values.
Definition at line 1261 of file EmitC.cpp.
References mlir::AsmParser::getBuilder(), mlir::Builder::getDenseI64ArrayAttr(), mlir::AsmParser::parseInteger(), mlir::AsmParser::parseOptionalKeyword(), and mlir::OpAsmParser::parseRegion().
|
static |
Definition at line 1141 of file EmitC.cpp.
References mlir::AsmPrinter::printAttributeWithoutType().
|
static |
Print the case regions and values.
Definition at line 1277 of file EmitC.cpp.
References mlir::detail::DenseArrayAttrImpl< T >::asArrayRef(), mlir::OpAsmPrinter::printNewline(), and mlir::OpAsmPrinter::printRegion().
Check that the type of the initial value is compatible with the operations result type.
Definition at line 142 of file EmitC.cpp.
References mlir::Operation::emitOpError(), mlir::Operation::getNumResults(), mlir::Operation::getResult(), mlir::Value::getType(), mlir::Type::isIndex(), and mlir::emitc::isPointerWideType().
|
static |
Definition at line 1286 of file EmitC.cpp.
References mlir::Block::back(), mlir::Region::front(), and mlir::Operation::getName().