[mlir][spirv] Explicitly construct ArrayRef from array
authorLei Zhang <antiagainst@google.com>
Fri, 17 Jan 2020 18:44:37 +0000 (13:44 -0500)
committerLei Zhang <antiagainst@google.com>
Fri, 17 Jan 2020 18:44:37 +0000 (13:44 -0500)
Hopefully this pleases GCC 5.

mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp

index e871627..806d5fe 100644 (file)
@@ -1311,7 +1311,8 @@ static bool emitCapabilityImplication(const RecordKeeper &recordKeeper,
     mlir::interleaveComma(impliedCapsDefs, os, [&](const Record *capDef) {
       os << "Capability::" << EnumAttrCase(capDef).getSymbol();
     });
-    os << "}; return implies; }\n";
+    os << "}; return ArrayRef<Capability>(implies, " << impliedCapsDefs.size()
+       << "); }\n";
   }
   os << "  }\n";
   os << "}\n";