[mlir] ODS: do not emit trailing const for static methods

The generated C++ would be invalid.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D104233
This commit is contained in:
Alex Zinenko 2021-06-14 17:26:03 +02:00
parent 69cfa178b7
commit 8ed8855958

View File

@ -325,7 +325,7 @@ void InterfaceGenerator::emitTraitDecl(Interface &interface,
os << " " << (method.isStatic() ? "static " : "");
emitCPPType(method.getReturnType(), os);
emitMethodNameAndArgs(method, os, valueType, /*addThisArg=*/false,
/*addConst=*/!isOpInterface);
/*addConst=*/!isOpInterface && !method.isStatic());
os << " {\n " << tblgen::tgfmt(defaultImpl->trim(), &traitMethodFmt)
<< "\n }\n";
}