From ac2aaa3788cc5e7e2bd3752ad9f71e37f411bdca Mon Sep 17 00:00:00 2001 From: River Riddle Date: Thu, 30 Apr 2020 10:56:33 -0700 Subject: [PATCH] [mlir][OpInterfaceGen] Emit the utility Trait decl as a class and not using directive This fixes the build on MSVC where it is unable to handle template-template using directives properly. --- mlir/tools/mlir-tblgen/OpInterfacesGen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp index ae86f71..a693b02 100644 --- a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp +++ b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp @@ -179,9 +179,10 @@ static void emitTraitDecl(OpInterface &interface, raw_ostream &os, os << " };\n"; - // Emit a utility using directive for the trait class. + // Emit a utility wrapper trait class. os << " template \n " - << llvm::formatv("using Trait = {0}Trait;\n", interfaceName); + << llvm::formatv("struct Trait : public {0}Trait {{};\n", + interfaceName); } static void emitInterfaceDecl(OpInterface &interface, raw_ostream &os) { -- 2.7.4