Skip to content

Commit 77cad11

Browse files
ftynsekiranchandramohan
authored andcommitted
[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
1 parent fbb3d2e commit 77cad11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/tools/mlir-tblgen/OpInterfacesGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ void InterfaceGenerator::emitTraitDecl(Interface &interface,
325325
os << " " << (method.isStatic() ? "static " : "");
326326
emitCPPType(method.getReturnType(), os);
327327
emitMethodNameAndArgs(method, os, valueType, /*addThisArg=*/false,
328-
/*addConst=*/!isOpInterface);
328+
/*addConst=*/!isOpInterface && !method.isStatic());
329329
os << " {\n " << tblgen::tgfmt(defaultImpl->trim(), &traitMethodFmt)
330330
<< "\n }\n";
331331
}

0 commit comments

Comments
 (0)