Skip to content

Commit 7f684c9

Browse files
authored
[mlir] Avoid doublespace in error (NFC). (#136560)
This was resulting in 2 spaces in the error message.
1 parent a25fdd7 commit 7f684c9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

mlir/lib/Interfaces/ControlFlowInterfaces.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ verifyTypesAlongAllEdges(Operation *op, RegionBranchPoint sourcePoint,
120120

121121
TypeRange succInputsTypes = succ.getSuccessorInputs().getTypes();
122122
if (sourceTypes->size() != succInputsTypes.size()) {
123-
InFlightDiagnostic diag = op->emitOpError(" region control flow edge ");
123+
InFlightDiagnostic diag = op->emitOpError("region control flow edge ");
124124
return printRegionEdgeName(diag, sourcePoint, succ)
125125
<< ": source has " << sourceTypes->size()
126126
<< " operands, but target successor needs "
@@ -132,7 +132,7 @@ verifyTypesAlongAllEdges(Operation *op, RegionBranchPoint sourcePoint,
132132
Type sourceType = std::get<0>(typesIdx.value());
133133
Type inputType = std::get<1>(typesIdx.value());
134134
if (!regionInterface.areTypesCompatible(sourceType, inputType)) {
135-
InFlightDiagnostic diag = op->emitOpError(" along control flow edge ");
135+
InFlightDiagnostic diag = op->emitOpError("along control flow edge ");
136136
return printRegionEdgeName(diag, sourcePoint, succ)
137137
<< ": source type #" << typesIdx.index() << " " << sourceType
138138
<< " should match input type #" << typesIdx.index() << " "
@@ -202,7 +202,7 @@ LogicalResult detail::verifyTypesAlongControlFlowEdges(Operation *op) {
202202
// types match with the first one.
203203
if (!areTypesCompatible(regionReturnOperands->getTypes(),
204204
terminatorOperands.getTypes())) {
205-
InFlightDiagnostic diag = op->emitOpError(" along control flow edge");
205+
InFlightDiagnostic diag = op->emitOpError("along control flow edge");
206206
return printRegionEdgeName(diag, region, point)
207207
<< " operands mismatch between return-like terminators";
208208
}

mlir/test/Dialect/SCF/invalid.mlir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ func.func @while_invalid_terminator() {
544544

545545
func.func @while_cross_region_type_mismatch() {
546546
%true = arith.constant true
547-
// expected-error@+1 {{'scf.while' op region control flow edge from Region #0 to Region #1: source has 0 operands, but target successor needs 1}}
547+
// expected-error@+1 {{'scf.while' op region control flow edge from Region #0 to Region #1: source has 0 operands, but target successor needs 1}}
548548
scf.while : () -> () {
549549
scf.condition(%true)
550550
} do {
@@ -557,7 +557,7 @@ func.func @while_cross_region_type_mismatch() {
557557

558558
func.func @while_cross_region_type_mismatch() {
559559
%true = arith.constant true
560-
// expected-error@+1 {{'scf.while' op along control flow edge from Region #0 to Region #1: source type #0 'i1' should match input type #0 'i32'}}
560+
// expected-error@+1 {{'scf.while' op along control flow edge from Region #0 to Region #1: source type #0 'i1' should match input type #0 'i32'}}
561561
%0 = scf.while : () -> (i1) {
562562
scf.condition(%true) %true : i1
563563
} do {
@@ -570,7 +570,7 @@ func.func @while_cross_region_type_mismatch() {
570570

571571
func.func @while_result_type_mismatch() {
572572
%true = arith.constant true
573-
// expected-error@+1 {{'scf.while' op region control flow edge from Region #0 to parent results: source has 1 operands, but target successor needs 0}}
573+
// expected-error@+1 {{'scf.while' op region control flow edge from Region #0 to parent results: source has 1 operands, but target successor needs 0}}
574574
scf.while : () -> () {
575575
scf.condition(%true) %true : i1
576576
} do {

0 commit comments

Comments
 (0)