Skip to content

Commit ce7de0c

Browse files
committed
Keep textual output format matching old
1 parent e1a6e4d commit ce7de0c

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

mlir/lib/IR/AsmPrinter.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,15 +2014,6 @@ void AsmPrinter::Impl::printLocationInternal(LocationAttr loc, bool pretty,
20142014
os << loc.getFilename().getValue();
20152015
else
20162016
printEscapedString(loc.getFilename());
2017-
if (loc.getStartLine() == 0 && loc.getStartColumn() == 0 &&
2018-
loc.getEndLine() == 0 && loc.getEndColumn() == 0) {
2019-
return;
2020-
}
2021-
if (loc.getStartColumn() == 0 &&
2022-
loc.getStartLine() == loc.getEndLine()) {
2023-
os << ':' << loc.getStartLine();
2024-
return;
2025-
}
20262017
if (loc.getEndColumn() == loc.getStartColumn() &&
20272018
loc.getStartLine() == loc.getEndLine()) {
20282019
os << ':' << loc.getStartLine() << ':' << loc.getStartColumn();

mlir/test/IR/locations.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func.func @inline_notation() -> i32 {
3333
// CHECK-LABEL: func private @loc_attr(i1 {foo.loc_attr = loc(callsite("foo" at "mysource.cc":10:8))})
3434
func.func private @loc_attr(i1 {foo.loc_attr = loc(callsite("foo" at "mysource.cc":10:8))})
3535

36-
// CHECK-LABEL: func.func private @filelocrange_attr1(i1 {foo.loc_attr = loc("mysource.cc":10)})
36+
// CHECK-LABEL: func.func private @filelocrange_attr1(i1 {foo.loc_attr = loc("mysource.cc":10:0)})
3737
func.func private @filelocrange_attr1(i1 {foo.loc_attr = loc("mysource.cc":10)})
3838
// CHECK-LABEL: func.func private @filelocrange_attr2(i1 {foo.loc_attr = loc("mysource.cc":10:8)})
3939
func.func private @filelocrange_attr2(i1 {foo.loc_attr = loc("mysource.cc":10:8)})

0 commit comments

Comments
 (0)