[Mlir-commits] [mlir] [mlir] Fix c++20 compat warning. NFC. (PR #65801)

Jakub Kuderski llvmlistbot at llvm.org
Fri Sep 8 13:17:08 PDT 2023


https://github.com/kuhar created https://github.com/llvm/llvm-project/pull/65801:

`concept` is a c++20 keyword and makes some buildbots fail: https://lab.llvm.org/buildbot/#/builders/160/builds/24345

>From dd099eb35cbabb145eedab14d40bea4cb4150d88 Mon Sep 17 00:00:00 2001
From: Jakub Kuderski <jakub at nod-labs.com>
Date: Fri, 8 Sep 2023 16:14:26 -0400
Subject: [PATCH] [mlir] Fix c++20 compat warning. NFC.

`concept` is a c++20 keyword and makes some buildbots fail:
https://lab.llvm.org/buildbot/#/builders/160/builds/24345
---
 mlir/test/mlir-tblgen/op-interface.td      | 6 +++---
 mlir/tools/mlir-tblgen/OpInterfacesGen.cpp | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/mlir/test/mlir-tblgen/op-interface.td b/mlir/test/mlir-tblgen/op-interface.td
index 6ca9f15bd022097..17bd631fe250d16 100644
--- a/mlir/test/mlir-tblgen/op-interface.td
+++ b/mlir/test/mlir-tblgen/op-interface.td
@@ -11,10 +11,10 @@ def ExtraClassOfInterface : OpInterface<"ExtraClassOfInterface"> {
 
 // DECL: class ExtraClassOfInterface
 // DECL:   static bool classof(::mlir::Operation * base) {
-// DECL-NEXT:     auto* concept = getInterfaceFor(base);
-// DECL-NEXT:     if (!concept)
+// DECL-NEXT:     auto* interface = getInterfaceFor(base);
+// DECL-NEXT:     if (!interface)
 // DECL-NEXT:       return false;
-// DECL-NEXT:     ExtraClassOfInterface odsInterfaceInstance(base, concept);
+// DECL-NEXT:     ExtraClassOfInterface odsInterfaceInstance(base, interface);
 // DECL-NEXT:     return odsInterfaceInstance->someOtherMethod();
 // DECL-NEXT:   }
 
diff --git a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
index bdc8482ce5d2724..65c1e6392b1316e 100644
--- a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
@@ -584,10 +584,10 @@ void InterfaceGenerator::emitInterfaceDecl(const Interface &interface) {
     auto extraClassOfFmt = tblgen::FmtContext();
     extraClassOfFmt.addSubst(substVar, "odsInterfaceInstance");
     os << "  static bool classof(" << valueType << " base) {\n"
-       << "    auto* concept = getInterfaceFor(base);\n"
-       << "    if (!concept)\n"
+       << "    auto* interface = getInterfaceFor(base);\n"
+       << "    if (!interface)\n"
           "      return false;\n"
-          "    " << interfaceName << " odsInterfaceInstance(base, concept);\n"
+          "    " << interfaceName << " odsInterfaceInstance(base, interface);\n"
        << "    " << tblgen::tgfmt(extraClassOf->trim(), &extraClassOfFmt)
        << "\n  }\n";
   }



More information about the Mlir-commits mailing list