Change trailing locations printing to also print unknown locations. This will allow for truly round tripping debug locations given that we assign locations while parsing IR.

PiperOrigin-RevId: 230627191
This commit is contained in:
River Riddle 2019-01-23 16:37:45 -08:00 committed by jpienaar
parent 6859f33292
commit 98c729d6f1
2 changed files with 3 additions and 7 deletions

View File

@ -419,11 +419,8 @@ void ModulePrinter::printTrailingLocation(Location loc) {
if (!shouldPrintDebugInfoOpt)
return;
// If the location is not unknown then print it.
if (!loc.isa<UnknownLoc>()) {
os << " ";
printLocation(loc);
}
os << " ";
printLocation(loc);
}
void ModulePrinter::printLocationInternal(Location loc) {

View File

@ -20,7 +20,6 @@ func @inline_notation() -> i32 loc("mysource.cc":10:8) {
if #set0(%2) loc(fused<"myPass">["foo", "foo2"]) {
}
// Unknown locations are not printed.
// CHECK: return %0 : {{i32$}}
// CHECK: return %0 : i32 loc(unknown)
return %1 : i32 loc(unknown)
}