Skip to content

Commit 2d7a19c

Browse files
committed
Fir MLIR tests
1 parent 921521b commit 2d7a19c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mlir/lib/IR/Diagnostics.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,10 @@ struct SourceMgrDiagnosticHandlerImpl {
378378
}
379379

380380
// Otherwise, try to load the source file.
381-
std::string ignored;
382-
unsigned id = mgr.AddIncludeFile(std::string(filename), SMLoc(), ignored);
381+
auto bufferOrErr = llvm::MemoryBuffer::getFile(filename);
382+
if (!bufferOrErr)
383+
return 0;
384+
unsigned id = mgr.AddNewSourceBuffer(std::move(*bufferOrErr), SMLoc());
383385
filenameToBufId[filename] = id;
384386
return id;
385387
}

0 commit comments

Comments
 (0)