From 49d840c35c69d3483ae77f94fc62c36f727b9321 Mon Sep 17 00:00:00 2001 From: Marius Brehler Date: Thu, 22 Jul 2021 12:06:52 +0000 Subject: [PATCH] [mlir] Improve description of interface options Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D106539 --- mlir/tools/mlir-tblgen/OpInterfacesGen.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp index a365b42621cd..b28cfbb22506 100644 --- a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp +++ b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp @@ -544,29 +544,35 @@ bool InterfaceGenerator::emitInterfaceDocs() { //===----------------------------------------------------------------------===// namespace { -template struct InterfaceGenRegistration { - InterfaceGenRegistration(StringRef genArg) +template +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 attrGen("attr"); -static InterfaceGenRegistration opGen("op"); -static InterfaceGenRegistration typeGen("type"); +static InterfaceGenRegistration attrGen("attr", + "attribute"); +static InterfaceGenRegistration opGen("op", "op"); +static InterfaceGenRegistration typeGen("type", "type");