MLIR  20.0.0git
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
mlir::tblgen Namespace Reference

Namespaces

 detail
 

Classes

struct  NamedAttribute
 
struct  NamedTypeConstraint
 
class  AttrConstraint
 
class  Attribute
 
class  ConstantAttr
 
class  EnumAttrCase
 
class  EnumAttr
 
class  AttrOrTypeBuilder
 Wrapper class that represents a Tablegen AttrOrTypeBuilder. More...
 
class  AttrOrTypeParameter
 A wrapper class for tblgen AttrOrTypeParameter, arrays of which belong to AttrOrTypeDefs to parameterize them. More...
 
class  AttributeSelfTypeParameter
 
class  AttrOrTypeDef
 Wrapper class that contains a TableGen AttrOrTypeDef's record and provides helper methods for accessing them. More...
 
class  AttrDef
 This class represents a wrapper around a tablegen AttrDef record. More...
 
class  TypeDef
 This class represents a wrapper around a tablegen TypeDef record. More...
 
class  Builder
 Wrapper class with helper methods for accessing Builders defined in TableGen. More...
 
class  MethodParameter
 This class contains a single method parameter for a C++ function. More...
 
class  MethodParameters
 This class contains a list of method parameters for constructor, class methods, and method signatures. More...
 
class  MethodSignature
 This class contains the signature of a C++ method, including the return type. More...
 
class  MethodBody
 This class contains the body of a C++ method. More...
 
class  ClassDeclaration
 A class declaration is a class element that appears as part of its declaration. More...
 
class  ClassDeclarationBase
 Base class for class declarations. More...
 
class  Method
 Class for holding an op's method for C++ code emission. More...
 
class  Constructor
 
class  ParentClass
 This class describes a C++ parent class declaration. More...
 
class  UsingDeclaration
 This class describes a using-declaration for a class. More...
 
class  Field
 This class describes a class field. More...
 
class  VisibilityDeclaration
 A declaration for the visibility of subsequent declarations. More...
 
class  ExtraClassDeclaration
 Unstructured extra class declarations and definitions, from TableGen definitions. More...
 
class  Class
 A class used to emit C++ classes from Tablegen. More...
 
class  IfDefScope
 
class  NamespaceEmitter
 
class  StaticVerifierFunctionEmitter
 This class deduplicates shared operation verification code by emitting static functions alongside the op definitions. More...
 
class  Constraint
 
struct  AppliedConstraint
 
class  Dialect
 
class  FmtContext
 Format context containing substitutions for special placeholders. More...
 
struct  FmtReplacement
 Struct representing a replacement segment for the formatted string. More...
 
class  FmtObjectBase
 
class  FmtObject
 
class  FmtStrVecObject
 
class  InterfaceMethod
 
class  Interface
 
struct  AttrInterface
 
struct  OpInterface
 
struct  TypeInterface
 
class  InferredResultType
 This class represents an inferred result type. More...
 
class  Operator
 Wrapper class that contains a MLIR op's information (e.g., operands, attributes) defined in TableGen and provides helper methods for accessing them. More...
 
class  PassOption
 
class  PassStatistic
 
class  Pass
 Wrapper class providing helper methods for Passes defined in TableGen. More...
 
class  DagLeaf
 
class  DagNode
 
class  SymbolInfoMap
 
class  Pattern
 
class  Pred
 
class  CPred
 
class  CombinedPred
 
class  SubstLeavesPred
 
class  ConcatPred
 
class  Property
 
struct  NamedProperty
 
class  Region
 
struct  NamedRegion
 
class  SideEffect
 
class  SideEffectTrait
 
class  Successor
 
struct  NamedSuccessor
 
class  Trait
 
class  NativeTrait
 
class  PredTrait
 
class  InternalTrait
 
class  InterfaceTrait
 
class  TypeConstraint
 
class  Type
 

Typedefs

using Argument = llvm::PointerUnion< NamedAttribute *, NamedProperty *, NamedTypeConstraint * >
 
using RecordOperatorMap = DenseMap< const llvm::Record *, std::unique_ptr< Operator > >
 

Enumerations

enum class  Visibility { Public , Protected , Private }
 This enum describes C++ inheritance visibility. More...
 

Functions

llvm::raw_ostream & operator<< (llvm::raw_ostream &os, mlir::tblgen::Visibility visibility)
 Write "public", "protected", or "private". More...
 
template<typename... Parameters>
std::string strfmt (const char *fmt, Parameters &&...parameters)
 
std::string escapeString (StringRef value)
 Escape a string using C++ encoding. E.g. foo"bar -> foo\x22bar. More...
 
template<typename T >
std::string stringify (T &&t)
 Generically convert a value to a std::string. More...
 
template<typename... Ts>
auto tgfmt (StringRef fmt, const FmtContext *ctx, Ts &&...vals) -> FmtObject< decltype(std::make_tuple(llvm::support::detail::build_format_adapter(std::forward< Ts >(vals))...))>
 Formats text by substituting placeholders in format string with replacement parameters. More...
 
FmtStrVecObject tgfmt (StringRef fmt, const FmtContext *ctx, ArrayRef< std::string > params)
 

Variables

const char * inferTypeOpInterface = "InferTypeOpInterface"
 

Typedef Documentation

◆ Argument

Definition at line 63 of file Argument.h.

◆ RecordOperatorMap

using mlir::tblgen::RecordOperatorMap = typedef DenseMap<const llvm::Record *, std::unique_ptr<Operator> >

Definition at line 43 of file Pattern.h.

Enumeration Type Documentation

◆ Visibility

This enum describes C++ inheritance visibility.

Enumerator
Public 
Protected 
Private 

Definition at line 408 of file Class.h.

Function Documentation

◆ escapeString()

std::string mlir::tblgen::escapeString ( StringRef  value)

Escape a string using C++ encoding. E.g. foo"bar -> foo\x22bar.

Definition at line 314 of file CodeGenHelpers.cpp.

◆ operator<<()

llvm::raw_ostream& mlir::tblgen::operator<< ( llvm::raw_ostream &  os,
mlir::tblgen::Visibility  visibility 
)

Write "public", "protected", or "private".

◆ strfmt()

template<typename... Parameters>
std::string mlir::tblgen::strfmt ( const char *  fmt,
Parameters &&...  parameters 
)

Definition at line 35 of file CodeGenHelpers.h.

◆ stringify()

template<typename T >
std::string mlir::tblgen::stringify ( T &&  t)

◆ tgfmt() [1/2]

FmtStrVecObject mlir::tblgen::tgfmt ( StringRef  fmt,
const FmtContext ctx,
ArrayRef< std::string >  params 
)
inline

Definition at line 274 of file Format.h.

◆ tgfmt() [2/2]

template<typename... Ts>
auto mlir::tblgen::tgfmt ( StringRef  fmt,
const FmtContext ctx,
Ts &&...  vals 
) -> FmtObject< decltype(std::make_tuple(llvm::support::detail::build_format_adapter( std::forward<Ts>(vals))...))>
inline

Formats text by substituting placeholders in format string with replacement parameters.

There are two categories of placeholders accepted, both led by a '$' sign:

1.a Positional placeholder: $[0-9]+ 1.b Positional range placeholder: $[0-9]+...

  1. Special placeholder: $[a-zA-Z_][a-zA-Z0-9_]*

Replacement parameters for positional placeholders are supplied as the vals parameter pack with 1:1 mapping. That is, $0 will be replaced by the first parameter in vals, $1 by the second one, and so on. Note that you can use the positional placeholders in any order and repeat any times, for example, "$2 $1 $1 $0" is accepted.

Replace parameters for positional range placeholders are supplied as if positional placeholders were specified with commas separating them.

Replacement parameters for special placeholders are supplied using the ctx format context.

The fmt is recorded as a StringRef inside the returned FmtObject. The caller needs to make sure the underlying data is available when the FmtObject is used.

ctx accepts a nullptr if there is no special placeholder is used.

If no substitution is provided for a placeholder or any error happens during format string parsing or replacement, the placeholder will be outputted as-is with an additional marker '<no-subst-found>', to aid debugging.

To print a '$' literally, escape it with '$$'.

This utility function is inspired by LLVM formatv(), with modifications specially tailored for TableGen C++ generation usage:

  1. This utility use '$' instead of '{' and '}' for denoting the placeholder because '{' and '}' are frequently used in C++ code.
  2. This utility does not support format layout because it is rarely needed in C++ code generation.

Definition at line 262 of file Format.h.

Referenced by canUniqueAttrConstraint().

Variable Documentation

◆ inferTypeOpInterface

const char * mlir::tblgen::inferTypeOpInterface = "InferTypeOpInterface"
extern

Definition at line 243 of file Attribute.cpp.