12 #include "llvm/Support/raw_ostream.h"
21 Dialect::Dialect(StringRef name) : name(name.str()) {}
22 Dialect::~Dialect() =
default;
24 std::pair<Operation *, bool>
25 Dialect::insertOperation(StringRef name, StringRef summary, StringRef desc,
26 StringRef nativeClassName,
27 bool supportsResultTypeInferrence, llvm::SMLoc loc) {
28 std::unique_ptr<Operation> &operation = operations[name];
30 return std::make_pair(&*operation,
false);
32 operation.reset(
new Operation(name, summary, desc, nativeClassName,
33 supportsResultTypeInferrence, loc));
34 return std::make_pair(&*operation,
true);
37 Operation *Dialect::lookupOperation(StringRef name)
const {
38 auto it = operations.find(name);
39 return it != operations.end() ? it->second.get() :
nullptr;
This class provides an ODS representation of a specific operation.
Include the generated interface declarations.