From: Lei Zhang Date: Fri, 19 Jul 2019 16:39:14 +0000 (-0700) Subject: Suppress compiler warnings regarding unused variables X-Git-Tag: llvmorg-11-init~1466^2~1137 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e239f9647ede78c0f64af9fe625be2d498906612;p=platform%2Fupstream%2Fllvm.git Suppress compiler warnings regarding unused variables Not all ops have operands or results, so it ends up there may be no use of wordIndex or the generated op's results. PiperOrigin-RevId: 258984485 --- diff --git a/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp b/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp index 869fe1a..458183f 100644 --- a/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp +++ b/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp @@ -210,7 +210,7 @@ static void emitDeserializationFunction(const Record *record, op.getQualCppClassName()); os << " {\n"; os << " SmallVector resultTypes;\n"; - os << " size_t wordIndex = 0;\n"; + os << " size_t wordIndex = 0; (void)wordIndex;\n"; // Deserialize result information if it exists bool hasResult = false; @@ -270,7 +270,7 @@ static void emitDeserializationFunction(const Record *record, } os << formatv(" auto op = opBuilder.create<{0}>(unknownLoc, resultTypes, " - "operands, attributes);\n", + "operands, attributes); (void)op;\n", op.getQualCppClassName()); if (hasResult) { os << " valueMap[valueID] = op.getResult();\n";