9 #ifndef MLIR_TABLEGEN_GENINFO_H_
10 #define MLIR_TABLEGEN_GENINFO_H_
13 #include "llvm/ADT/StringRef.h"
25 std::function<bool(
const llvm::RecordKeeper &records, raw_ostream &os)>;
34 : arg(arg), description(description), generator(std::move(generator)) {}
37 bool invoke(
const llvm::RecordKeeper &records, raw_ostream &os)
const {
38 assert(generator &&
"Cannot call generator with null generator");
39 return generator(records, os);
54 StringRef description;
Structure to group information about a generator (argument to invoke via mlir-tblgen,...
GenInfo(StringRef arg, StringRef description, GenFunction generator)
GenInfo constructor should not be invoked directly, instead use GenRegistration or registerGen.
StringRef getGenDescription() const
Returns a description for the generator.
bool invoke(const llvm::RecordKeeper &records, raw_ostream &os) const
Invokes the generator and returns whether the generator failed.
StringRef getGenArgument() const
Returns the command line option that may be passed to 'mlir-tblgen' to invoke this generator.
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Include the generated interface declarations.
std::function< bool(const llvm::RecordKeeper &records, raw_ostream &os)> GenFunction
Generator function to invoke.
GenRegistration provides a global initializer that registers a generator function.
GenRegistration(StringRef arg, StringRef description, const GenFunction &function)