MLIR
15.0.0git
|
#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/DialectImplementation.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/TypeSwitch.h"
Go to the source code of this file.
Functions | |
static void | dispatchPrint (AsmPrinter &printer, Type type) |
If the given type is compatible with the LLVM dialect, prints it using internal functions to avoid getting a verbose !llvm prefix. More... | |
static StringRef | getTypeKeyword (Type type) |
Returns the keyword to use for the given type. More... | |
static void | printStructType (AsmPrinter &printer, LLVMStructType type) |
Prints a structure type. More... | |
template<typename TypeTy > | |
static void | printArrayOrVectorType (AsmPrinter &printer, TypeTy type) |
Prints a type containing a fixed number of elements. More... | |
static void | printFunctionType (AsmPrinter &printer, LLVMFunctionType funcType) |
Prints a function type. More... | |
static ParseResult | dispatchParse (AsmParser &parser, Type &type) |
Helper to use in parse lists. More... | |
static LLVMFunctionType | parseFunctionType (AsmParser &parser) |
Parses an LLVM dialect function type. More... | |
static LLVMPointerType | parsePointerType (AsmParser &parser) |
Parses an LLVM dialect pointer type. More... | |
static Type | parseVectorType (AsmParser &parser) |
Parses an LLVM dialect vector type. More... | |
static LLVMArrayType | parseArrayType (AsmParser &parser) |
Parses an LLVM dialect array type. More... | |
static LLVMStructType | trySetStructBody (LLVMStructType type, ArrayRef< Type > subtypes, bool isPacked, AsmParser &parser, SMLoc subtypesLoc) |
Attempts to set the body of an identified structure type. More... | |
static LLVMStructType | parseStructType (AsmParser &parser) |
Parses an LLVM dialect structure type. More... | |
static Type | dispatchParse (AsmParser &parser, bool allowAny=true) |
Parses a type appearing inside another LLVM dialect-compatible type. More... | |
|
static |
Helper to use in parse lists.
Definition at line 480 of file LLVMTypeSyntax.cpp.
Parses a type appearing inside another LLVM dialect-compatible type.
This will try to parse any type in full form (including types with the !llvm
prefix), and on failure fall back to parsing the short-hand version of the LLVM dialect types without the !llvm
prefix.
Definition at line 439 of file LLVMTypeSyntax.cpp.
|
static |
If the given type is compatible with the LLVM dialect, prints it using internal functions to avoid getting a verbose !llvm
prefix.
Otherwise prints it as usual.
Definition at line 26 of file LLVMTypeSyntax.cpp.
References mlir::Type::isa(), mlir::LLVM::isCompatibleType(), mlir::AsmPrinter::printType(), and mlir::LLVM::detail::printType().
|
static |
Returns the keyword to use for the given type.
Definition at line 33 of file LLVMTypeSyntax.cpp.
|
static |
Parses an LLVM dialect array type.
llvm-type ::= array<
integer x
llvm-type >
Definition at line 292 of file LLVMTypeSyntax.cpp.
|
static |
Parses an LLVM dialect function type.
llvm-type :: = func<
llvm-type (
llvm-type-list ...
? )>
Definition at line 185 of file LLVMTypeSyntax.cpp.
|
static |
Parses an LLVM dialect pointer type.
llvm-type ::= ptr<
llvm-type (,
integer)? >
| ptr
(<
integer >
)?
Definition at line 225 of file LLVMTypeSyntax.cpp.
|
static |
Parses an LLVM dialect structure type.
llvm-type ::= struct<
(string-literal ,
)? packed
? (
llvm-type-list )
>
| struct<
string-literal >
| struct<
string-literal , opaque>
Definition at line 337 of file LLVMTypeSyntax.cpp.
Parses an LLVM dialect vector type.
llvm-type ::= vec<
? x
? integer x
llvm-type >
Supports both fixed and scalable vectors.
Definition at line 256 of file LLVMTypeSyntax.cpp.
|
static |
Prints a type containing a fixed number of elements.
Definition at line 104 of file LLVMTypeSyntax.cpp.
|
static |
Prints a function type.
Definition at line 111 of file LLVMTypeSyntax.cpp.
|
static |
Prints a structure type.
Keeps track of known struct names to handle self- or mutually-referring structs without falling into infinite recursion.
Definition at line 54 of file LLVMTypeSyntax.cpp.
References mlir::LLVM::LLVMStructType::getName(), and mlir::LLVM::LLVMStructType::isIdentified().
|
static |
Attempts to set the body of an identified structure type.
Reports a parsing error at subtypesLoc
in case of failure.
Definition at line 312 of file LLVMTypeSyntax.cpp.