[Mlir-commits] [mlir] 49d840c - [mlir] Improve description of interface options
Marius Brehler
llvmlistbot at llvm.org
Thu Jul 22 10:36:50 PDT 2021
Author: Marius Brehler
Date: 2021-07-22T19:35:56+02:00
New Revision: 49d840c35c69d3483ae77f94fc62c36f727b9321
URL: https://github.com/llvm/llvm-project/commit/49d840c35c69d3483ae77f94fc62c36f727b9321
DIFF: https://github.com/llvm/llvm-project/commit/49d840c35c69d3483ae77f94fc62c36f727b9321.diff
LOG: [mlir] Improve description of interface options
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D106539
Added:
Modified:
mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
Removed:
################################################################################
diff --git a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
index a365b42621cdc..b28cfbb225060 100644
--- a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
@@ -544,29 +544,35 @@ bool InterfaceGenerator::emitInterfaceDocs() {
//===----------------------------------------------------------------------===//
namespace {
-template <typename GeneratorT> struct InterfaceGenRegistration {
- InterfaceGenRegistration(StringRef genArg)
+template <typename GeneratorT>
+struct InterfaceGenRegistration {
+ InterfaceGenRegistration(StringRef genArg, StringRef genDesc)
: genDeclArg(("gen-" + genArg + "-interface-decls").str()),
genDefArg(("gen-" + genArg + "-interface-defs").str()),
genDocArg(("gen-" + genArg + "-interface-docs").str()),
- genDecls(genDeclArg, "Generate interface declarations",
+ genDeclDesc(("Generate " + genDesc + " interface declarations").str()),
+ genDefDesc(("Generate " + genDesc + " interface definitions").str()),
+ genDocDesc(("Generate " + genDesc + " interface documentation").str()),
+ genDecls(genDeclArg, genDeclDesc,
[](const llvm::RecordKeeper &records, raw_ostream &os) {
return GeneratorT(records, os).emitInterfaceDecls();
}),
- genDefs(genDefArg, "Generate interface definitions",
+ genDefs(genDefArg, genDefDesc,
[](const llvm::RecordKeeper &records, raw_ostream &os) {
return GeneratorT(records, os).emitInterfaceDefs();
}),
- genDocs(genDocArg, "Generate interface documentation",
+ genDocs(genDocArg, genDocDesc,
[](const llvm::RecordKeeper &records, raw_ostream &os) {
return GeneratorT(records, os).emitInterfaceDocs();
}) {}
std::string genDeclArg, genDefArg, genDocArg;
+ std::string genDeclDesc, genDefDesc, genDocDesc;
mlir::GenRegistration genDecls, genDefs, genDocs;
};
} // end anonymous namespace
-static InterfaceGenRegistration<AttrInterfaceGenerator> attrGen("attr");
-static InterfaceGenRegistration<OpInterfaceGenerator> opGen("op");
-static InterfaceGenRegistration<TypeInterfaceGenerator> typeGen("type");
+static InterfaceGenRegistration<AttrInterfaceGenerator> attrGen("attr",
+ "attribute");
+static InterfaceGenRegistration<OpInterfaceGenerator> opGen("op", "op");
+static InterfaceGenRegistration<TypeInterfaceGenerator> typeGen("type", "type");
More information about the Mlir-commits
mailing list