summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mlir/lib/IR/Diagnostics.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/mlir/lib/IR/Diagnostics.cpp b/mlir/lib/IR/Diagnostics.cpp
index 076a9b21ae5..28894066023 100644
--- a/mlir/lib/IR/Diagnostics.cpp
+++ b/mlir/lib/IR/Diagnostics.cpp
@@ -415,12 +415,10 @@ void SourceMgrDiagnosticHandler::emitDiagnostic(Location loc, Twine message,
if (smloc.isValid())
return mgr.PrintMessage(os, smloc, getDiagKind(kind), message);
- // If the conversion was unsuccessful, create a diagnostic with the source
- // location information directly.
- llvm::SMDiagnostic diag(mgr, llvm::SMLoc(), fileLoc->getFilename(),
- fileLoc->getLine(), fileLoc->getColumn(),
- getDiagKind(kind), message.str(), /*LineStr=*/"",
- /*Ranges=*/llvm::None);
+ // If the conversion was unsuccessful, create a diagnostic with the file
+ // information.
+ llvm::SMDiagnostic diag(fileLoc->getFilename(), getDiagKind(kind),
+ message.str());
diag.print(nullptr, os);
}
OpenPOWER on IntegriCloud