MLIR  20.0.0git
Public Member Functions | List of all members
mlir::pdll::ods::Context Class Reference

This class contains all of the registered ODS operation classes. More...

#include "mlir/Tools/PDLL/ODS/Context.h"

Public Member Functions

 Context ()
 
 ~Context ()
 
const AttributeConstraintinsertAttributeConstraint (StringRef name, StringRef summary, StringRef cppClass)
 Insert a new attribute constraint with the context. More...
 
const TypeConstraintinsertTypeConstraint (StringRef name, StringRef summary, StringRef cppClass)
 Insert a new type constraint with the context. More...
 
DialectinsertDialect (StringRef name)
 Insert a new dialect with the context. More...
 
const DialectlookupDialect (StringRef name) const
 Lookup a dialect registered with the given name, or null if no dialect with that name was inserted. More...
 
auto getDialects () const
 Return a range of all of the registered dialects. More...
 
std::pair< Operation *, bool > insertOperation (StringRef name, StringRef summary, StringRef desc, StringRef nativeClassName, bool supportsResultTypeInferrence, SMLoc loc)
 Insert a new operation with the context. More...
 
const OperationlookupOperation (StringRef name) const
 Lookup an operation registered with the given name, or null if no operation with that name is registered. More...
 
void print (raw_ostream &os) const
 Print the contents of this context to the provided stream. More...
 

Detailed Description

This class contains all of the registered ODS operation classes.

Definition at line 32 of file Context.h.

Constructor & Destructor Documentation

◆ Context()

Context::Context ( )
default

◆ ~Context()

Context::~Context ( )
default

Member Function Documentation

◆ getDialects()

auto mlir::pdll::ods::Context::getDialects ( ) const
inline

Return a range of all of the registered dialects.

Definition at line 57 of file Context.h.

◆ insertAttributeConstraint()

const AttributeConstraint & Context::insertAttributeConstraint ( StringRef  name,
StringRef  summary,
StringRef  cppClass 
)

Insert a new attribute constraint with the context.

Returns the inserted constraint, or a previously inserted constraint with the same name.

Definition at line 28 of file Context.cpp.

◆ insertDialect()

Dialect & Context::insertDialect ( StringRef  name)

Insert a new dialect with the context.

Returns the inserted dialect, or a previously inserted dialect with the same name.

Definition at line 51 of file Context.cpp.

Referenced by insertOperation().

◆ insertOperation()

std::pair< Operation *, bool > Context::insertOperation ( StringRef  name,
StringRef  summary,
StringRef  desc,
StringRef  nativeClassName,
bool  supportsResultTypeInferrence,
SMLoc  loc 
)

Insert a new operation with the context.

Returns the inserted operation, and a boolean indicating if the operation newly inserted (false if the operation already existed).

Definition at line 64 of file Context.cpp.

References insertDialect(), and mlir::pdll::ods::Dialect::insertOperation().

◆ insertTypeConstraint()

const TypeConstraint & Context::insertTypeConstraint ( StringRef  name,
StringRef  summary,
StringRef  cppClass 
)

Insert a new type constraint with the context.

Returns the inserted constraint, or a previously inserted constraint with the same name.

Definition at line 42 of file Context.cpp.

◆ lookupDialect()

const Dialect * Context::lookupDialect ( StringRef  name) const

Lookup a dialect registered with the given name, or null if no dialect with that name was inserted.

Definition at line 58 of file Context.cpp.

Referenced by lookupOperation().

◆ lookupOperation()

const Operation * Context::lookupOperation ( StringRef  name) const

Lookup an operation registered with the given name, or null if no operation with that name is registered.

Definition at line 73 of file Context.cpp.

References lookupDialect().

◆ print()

void Context::print ( raw_ostream &  os) const

The documentation for this class was generated from the following files: