9 #ifndef MLIR_TABLEGEN_GENINFO_H_ 10 #define MLIR_TABLEGEN_GENINFO_H_ 13 #include "llvm/ADT/StringRef.h" 23 using GenFunction = std::function<bool(
const llvm::RecordKeeper &recordKeeper,
33 : arg(arg), description(description), generator(generator) {}
36 bool invoke(
const llvm::RecordKeeper &recordKeeper, raw_ostream &os)
const {
37 assert(generator &&
"Cannot call generator with null generator");
38 return generator(recordKeeper, os);
53 StringRef description;
72 #endif // MLIR_TABLEGEN_GENINFO_H_ Definition: InferTypeOpInterface.cpp:20
std::function< bool(const llvm::RecordKeeper &recordKeeper, raw_ostream &os)> GenFunction
Generator function to invoke.
Definition: GenInfo.h:24
StringRef getGenArgument() const
Definition: GenInfo.h:43
Definition: PassRegistry.cpp:413
StringRef getGenDescription() const
Returns a description for the generator.
Definition: GenInfo.h:46
GenInfo(StringRef arg, StringRef description, GenFunction generator)
Definition: GenInfo.h:32
bool invoke(const llvm::RecordKeeper &recordKeeper, raw_ostream &os) const
Invokes the generator and returns whether the generator failed.
Definition: GenInfo.h:36