[Mlir-commits] [mlir] 42060c0 - [mlir][DeclarativeParser][NFC] Use explicit type names in TypeSwitch to

River Riddle llvmlistbot at llvm.org
Fri Feb 21 16:14:57 PST 2020


Author: River Riddle
Date: 2020-02-21T16:14:13-08:00
New Revision: 42060c0a987076567814f97abdf485a55bf6018a

URL: https://github.com/llvm/llvm-project/commit/42060c0a987076567814f97abdf485a55bf6018a
DIFF: https://github.com/llvm/llvm-project/commit/42060c0a987076567814f97abdf485a55bf6018a.diff

LOG: [mlir][DeclarativeParser][NFC] Use explicit type names in TypeSwitch to
appease older GCC.

Older versions of GCC are unable to properly capture 'this' in template lambdas,
resulting in errors.

Added: 
    

Modified: 
    mlir/tools/mlir-tblgen/OpFormatGen.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
index 3655bf795c8b..17c85195820e 100644
--- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp
@@ -1684,7 +1684,7 @@ LogicalResult FormatParser::parseOptionalChildElement(
       })
       // Only optional-like(i.e. variadic) operands can be within an optional
       // group.
-      .Case<OperandVariable>([&](auto *ele) {
+      .Case<OperandVariable>([&](OperandVariable *ele) {
         if (!ele->getVar()->isVariadic())
           return emitError(childLoc, "only variadic operands can be used within"
                                      " an optional group");
@@ -1694,13 +1694,13 @@ LogicalResult FormatParser::parseOptionalChildElement(
       // Literals and type directives may be used, but they can't anchor the
       // group.
       .Case<LiteralElement, TypeDirective, FunctionalTypeDirective>(
-          [&](auto *) {
+          [&](Element *) {
             if (isAnchor)
               return emitError(childLoc, "only variables can be used to anchor "
                                          "an optional group");
             return success();
           })
-      .Default([&](auto *) {
+      .Default([&](Element *) {
         return emitError(childLoc, "only literals, types, and variables can be "
                                    "used within an optional group");
       });


        


More information about the Mlir-commits mailing list