Skip to content

Commit a6d76cf

Browse files
committed
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
1 parent 2da13f1 commit a6d76cf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mlir/lib/Support/ToolUtilities.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer> originalBuffer,
3737
auto splitLoc = llvm::SMLoc::getFromPointer(subBuffer.data());
3838
unsigned splitLine = fileSourceMgr.getLineAndColumn(splitLoc).first;
3939
auto subMemBuffer = llvm::MemoryBuffer::getMemBufferCopy(
40-
subBuffer, origMemBuffer->getBufferIdentifier() +
41-
Twine(" split at line #") + Twine(splitLine));
40+
subBuffer, Twine("within split at ") +
41+
origMemBuffer->getBufferIdentifier() + ":" +
42+
Twine(splitLine) + " offset ");
4243
if (failed(processChunkBuffer(std::move(subMemBuffer), os)))
4344
hadFailure = true;
4445
}

0 commit comments

Comments
 (0)