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

Namespaces

 detail
 

Classes

struct  AppliedConstraint
 
class  AttrConstraint
 
class  AttrDef
 This class represents a wrapper around a tablegen AttrDef record. More...
 
class  Attribute
 
class  AttributeSelfTypeParameter
 
struct  AttrInterface
 
class  AttrOrTypeBuilder
 Wrapper class that represents a Tablegen AttrOrTypeBuilder. More...
 
class  AttrOrTypeDef
 Wrapper class that contains a TableGen AttrOrTypeDef's record and provides helper methods for accessing them. More...
 
class  AttrOrTypeParameter
 A wrapper class for tblgen AttrOrTypeParameter, arrays of which belong to AttrOrTypeDefs to parameterize them. More...
 
class  Builder
 Wrapper class with helper methods for accessing Builders defined in TableGen. More...
 
class  Class
 A class used to emit C++ classes from Tablegen. 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  CombinedPred
 
class  ConcatPred
 
class  ConstantAttr
 
class  Constraint
 
class  Constructor
 
class  CPred
 
class  DagLeaf
 
class  DagNode
 
class  Dialect
 
class  EnumAttr
 
class  EnumAttrCase
 
class  ExtraClassDeclaration
 Unstructured extra class declarations and definitions, from TableGen definitions. More...
 
class  Field
 This class describes a class field. More...
 
class  FmtContext
 Format context containing substitutions for special placeholders. More...
 
class  FmtObject
 
class  FmtObjectBase
 
struct  FmtReplacement
 Struct representing a replacement segment for the formatted string. More...
 
class  FmtStrVecObject
 
class  IfDefScope
 
class  Interface
 
class  InterfaceMethod
 
class  InterfaceTrait
 
class  InternalTrait
 
class  Method
 Class for holding an op's method for C++ code emission. More...
 
class  MethodBody
 This class contains the body of a C++ method. 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...
 
struct  NamedAttribute
 
struct  NamedRegion
 
struct  NamedSuccessor
 
struct  NamedTypeConstraint
 
class  NamespaceEmitter
 
class  NativeTrait
 
class  Operator
 
struct  OpInterface
 
class  ParentClass
 This class describes a C++ parent class declaration. More...
 
class  Pass
 Wrapper class providing helper methods for Passes defined in TableGen. More...
 
class  PassOption
 
class  PassStatistic
 
class  Pattern
 
class  Pred
 
class  PredTrait
 
class  Region
 
class  SideEffect
 
class  SideEffectTrait
 
class  StaticVerifierFunctionEmitter
 This class deduplicates shared operation verification code by emitting static functions alongside the op definitions. More...
 
class  SubstLeavesPred
 
class  Successor
 
class  SymbolInfoMap
 
class  Trait
 
class  Type
 
class  TypeConstraint
 
class  TypeDef
 This class represents a wrapper around a tablegen TypeDef record. More...
 
struct  TypeInterface
 
class  UsingDeclaration
 This class describes a using-declaration for a class. More...
 
class  VisibilityDeclaration
 A declaration for the visibility of subsequent declarations. More...
 

Typedefs

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

Enumerations

enum  Visibility { Visibility::Public, Visibility::Protected, Visibility::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. 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::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)
 
raw_ostream & operator<< (raw_ostream &os, Visibility visibility)
 Write "public", "protected", or "private". More...
 

Variables

const char * inferTypeOpInterface = "InferTypeOpInterface"
 

Typedef Documentation

◆ Argument

Definition at line 62 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 369 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.

Definition at line 312 of file CodeGenHelpers.cpp.

◆ operator<<() [1/2]

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

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

Definition at line 199 of file Class.cpp.

References Private, Protected, and Public.

◆ operator<<() [2/2]

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

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

Definition at line 199 of file Class.cpp.

References Private, Protected, and Public.

◆ strfmt()

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

Definition at line 34 of file CodeGenHelpers.h.

◆ stringify()

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

Generically convert a value to a std::string.

Definition at line 240 of file CodeGenHelpers.h.

Referenced by mlir::tblgen::Constructor::addMemberInitializer(), mlir::tblgen::ParentClass::addTemplateParam(), and parseOptionalLLVMKeyword().

◆ tgfmt() [1/2]

template<typename... Ts>
auto mlir::tblgen::tgfmt ( StringRef  fmt,
const FmtContext ctx,
Ts &&...  vals 
) -> FmtObject<decltype(std::make_tuple( llvm::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 263 of file Format.h.

Referenced by canUniqueAttrConstraint().

◆ tgfmt() [2/2]

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

Definition at line 274 of file Format.h.

Variable Documentation

◆ inferTypeOpInterface

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

Definition at line 244 of file Attribute.cpp.

Referenced by mlir::tblgen::Operator::isVariadic().