diff --git a/mlir/lib/IR/Diagnostics.cpp b/mlir/lib/IR/Diagnostics.cpp --- a/mlir/lib/IR/Diagnostics.cpp +++ b/mlir/lib/IR/Diagnostics.cpp @@ -438,6 +438,9 @@ void SourceMgrDiagnosticHandler::emitDiagnostic(Diagnostic &diag) { // Emit the diagnostic. auto loc = diag.getLocation(); + if (auto fusedLoc = loc.dyn_cast()) { + loc = fusedLoc.getLocations().front(); + } emitDiagnostic(loc, diag.str(), diag.getSeverity()); // If the diagnostic location was a call site location, then print the call