diff options
author | Mehdi Amini <joker.eph@gmail.com> | 2021-02-27 18:32:21 +0000 |
---|---|---|
committer | Mehdi Amini <joker.eph@gmail.com> | 2021-02-27 18:32:34 +0000 |
commit | a6d76cf6101d0479af2d9c9266427c0ea51e3889 (patch) | |
tree | 9b56063b5a3d321e1449382821bc39b4d6d235f6 /mlir/lib/Support | |
parent | 2da13f1246e1f458d0d9eb716913616eb05f698d (diff) | |
download | llvm-a6d76cf6101d0479af2d9c9266427c0ea51e3889.tar.gz |
Change the error message when `-split-input-file` is used with mlir-opt to make it recognizable by IDEs
By adding the line number of the split point immediately after the file
name (separated by `:`) this is recognized by various tool as a proper
location.
Ideally we would want to point to the line of the error, but that would
require some very invasive changes I suspect.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D93363
Diffstat (limited to 'mlir/lib/Support')
-rw-r--r-- | mlir/lib/Support/ToolUtilities.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mlir/lib/Support/ToolUtilities.cpp b/mlir/lib/Support/ToolUtilities.cpp index 26a8b08f75af..ef1a41114fe9 100644 --- a/mlir/lib/Support/ToolUtilities.cpp +++ b/mlir/lib/Support/ToolUtilities.cpp @@ -37,8 +37,9 @@ mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer> originalBuffer, auto splitLoc = llvm::SMLoc::getFromPointer(subBuffer.data()); unsigned splitLine = fileSourceMgr.getLineAndColumn(splitLoc).first; auto subMemBuffer = llvm::MemoryBuffer::getMemBufferCopy( - subBuffer, origMemBuffer->getBufferIdentifier() + - Twine(" split at line #") + Twine(splitLine)); + subBuffer, Twine("within split at ") + + origMemBuffer->getBufferIdentifier() + ":" + + Twine(splitLine) + " offset "); if (failed(processChunkBuffer(std::move(subMemBuffer), os))) hadFailure = true; } |