[flang-commits] [flang] 2747887 - [ParseResult] Fix warning in flang build, incorporate feedback from River.
Chris Lattner via flang-commits
flang-commits at lists.llvm.org
Fri May 13 15:30:35 PDT 2022
Author: Chris Lattner
Date: 2022-05-13T23:30:27+01:00
New Revision: 27478872fd153b3edd123d586dd86210b3f59f2c
URL: https://github.com/llvm/llvm-project/commit/27478872fd153b3edd123d586dd86210b3f59f2c
DIFF: https://github.com/llvm/llvm-project/commit/27478872fd153b3edd123d586dd86210b3f59f2c.diff
LOG: [ParseResult] Fix warning in flang build, incorporate feedback from River.
The warning caused build errors on a couple flang testers that are
building with -Werror. The diagnostic change makes the generated
error correct.
This is a followup to https://reviews.llvm.org/D125549
Differential Revision: https://reviews.llvm.org/D125587
Added:
Modified:
flang/lib/Optimizer/Dialect/FIROps.cpp
mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
mlir/lib/Parser/AffineParser.cpp
mlir/test/IR/invalid.mlir
Removed:
################################################################################
diff --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp
index 210417306546..9e58afa74fad 100644
--- a/flang/lib/Optimizer/Dialect/FIROps.cpp
+++ b/flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -914,9 +914,9 @@ mlir::ParseResult fir::CoordinateOp::parse(mlir::OpAsmParser &parser,
if (parser.parseOptionalAttrDict(result.attributes) ||
parser.parseColonType(funcTy) ||
parser.resolveOperands(allOperands, funcTy.getInputs(), loc,
- result.operands))
+ result.operands) ||
+ parser.addTypesToList(funcTy.getResults(), result.types))
return mlir::failure();
- parser.addTypesToList(funcTy.getResults(), result.types);
result.addAttribute("baseType", mlir::TypeAttr::get(funcTy.getInput(0)));
return mlir::success();
}
diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
index 9a4626d27d3f..5d7d943eed93 100644
--- a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
+++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
@@ -3112,15 +3112,15 @@ void spirv::ModuleOp::build(OpBuilder &builder, OperationState &state,
ParseResult spirv::ModuleOp::parse(OpAsmParser &parser, OperationState &state) {
Region *body = state.addRegion();
- StringAttr nameAttr;
- spirv::AddressingModel addrModel;
- spirv::MemoryModel memoryModel;
// If the name is present, parse it.
+ StringAttr nameAttr;
(void)parser.parseOptionalSymbolName(
nameAttr, mlir::SymbolTable::getSymbolAttrName(), state.attributes);
// Parse attributes
+ spirv::AddressingModel addrModel;
+ spirv::MemoryModel memoryModel;
if (::parseEnumKeywordAttr(addrModel, parser, state) ||
::parseEnumKeywordAttr(memoryModel, parser, state))
return failure();
diff --git a/mlir/lib/Parser/AffineParser.cpp b/mlir/lib/Parser/AffineParser.cpp
index 96d256084711..3afc3c3d9f3c 100644
--- a/mlir/lib/Parser/AffineParser.cpp
+++ b/mlir/lib/Parser/AffineParser.cpp
@@ -518,7 +518,7 @@ ParseResult AffineParser::parseAffineMapOrIntegerSetInline(AffineMap &map,
if (consumeIf(Token::arrow))
return parseAffineMapRange(numDims, numSymbols, map);
- if (parseToken(Token::colon, "expected '->' or '['"))
+ if (parseToken(Token::colon, "expected '->' or ':'"))
return failure();
return parseIntegerSetConstraints(numDims, numSymbols, set);
}
diff --git a/mlir/test/IR/invalid.mlir b/mlir/test/IR/invalid.mlir
index c9004fa1e71e..7c802954f43b 100644
--- a/mlir/test/IR/invalid.mlir
+++ b/mlir/test/IR/invalid.mlir
@@ -932,7 +932,7 @@ func.func @invalid_tensor_literal() {
func.func @invalid_affine_structure() {
%c0 = arith.constant 0 : index
- %idx = affine.apply affine_map<(d0, d1)> (%c0, %c0) // expected-error {{expected '->' or '['}}
+ %idx = affine.apply affine_map<(d0, d1)> (%c0, %c0) // expected-error {{expected '->' or ':'}}
return
}
More information about the flang-commits
mailing list