[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.
This commit is contained in:
River Riddle 2020-04-30 10:56:33 -07:00
parent 8539588783
commit ac2aaa3788
1 changed files with 3 additions and 2 deletions

View File

@ -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 <typename ConcreteOp>\n "
<< llvm::formatv("using Trait = {0}Trait<ConcreteOp>;\n", interfaceName);
<< llvm::formatv("struct Trait : public {0}Trait<ConcreteOp> {{};\n",
interfaceName);
}
static void emitInterfaceDecl(OpInterface &interface, raw_ostream &os) {