Skip to content

Commit 5dc514a

Browse files
committed
MLIR
1 parent 049e8c9 commit 5dc514a

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

mlir/lib/Tools/PDLL/Parser/Parser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "llvm/Support/FormatVariadic.h"
2828
#include "llvm/Support/SaveAndRestore.h"
2929
#include "llvm/Support/ScopedPrinter.h"
30+
#include "llvm/Support/VirtualFileSystem.h"
3031
#include "llvm/TableGen/Error.h"
3132
#include "llvm/TableGen/Parser.h"
3233
#include <optional>
@@ -828,6 +829,7 @@ LogicalResult Parser::parseTdInclude(StringRef filename, llvm::SMRange fileLoc,
828829
llvm::SourceMgr tdSrcMgr;
829830
tdSrcMgr.AddNewSourceBuffer(std::move(*includeBuffer), SMLoc());
830831
tdSrcMgr.setIncludeDirs(parserSrcMgr.getIncludeDirs());
832+
tdSrcMgr.setVirtualFileSystem(llvm::vfs::getRealFileSystem());
831833

832834
// This class provides a context argument for the llvm::SourceMgr diagnostic
833835
// handler.

mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ PDLDocument::PDLDocument(const llvm::lsp::URIForFile &uri, StringRef contents,
402402
llvm::append_range(includeDirs, extraDirs);
403403

404404
sourceMgr.setIncludeDirs(includeDirs);
405+
sourceMgr.setVirtualFileSystem(llvm::vfs::getRealFileSystem());
405406
sourceMgr.AddNewSourceBuffer(std::move(memBuffer), SMLoc());
406407

407408
astContext.getDiagEngine().setHandlerFn([&](const ast::Diagnostic &diag) {

mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "llvm/Support/LSP/Logging.h"
1818
#include "llvm/Support/LSP/Protocol.h"
1919
#include "llvm/Support/Path.h"
20+
#include "llvm/Support/VirtualFileSystem.h"
2021
#include "llvm/TableGen/Parser.h"
2122
#include "llvm/TableGen/Record.h"
2223
#include <optional>
@@ -448,6 +449,7 @@ void TableGenTextFile::initialize(
448449
return;
449450
}
450451
sourceMgr.setIncludeDirs(includeDirs);
452+
sourceMgr.setVirtualFileSystem(llvm::vfs::getRealFileSystem());
451453
sourceMgr.AddNewSourceBuffer(std::move(memBuffer), SMLoc());
452454

453455
// This class provides a context argument for the SourceMgr diagnostic

mlir/tools/mlir-pdll/mlir-pdll.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ processBuffer(raw_ostream &os, std::unique_ptr<llvm::MemoryBuffer> chunkBuffer,
4141
OutputType outputType, std::vector<std::string> &includeDirs,
4242
bool dumpODS, std::set<std::string> *includedFiles) {
4343
llvm::SourceMgr sourceMgr;
44-
sourceMgr.setFileSystem(llvm::vfs::getRealFileSystem());
4544
sourceMgr.setIncludeDirs(includeDirs);
45+
sourceMgr.setVirtualFileSystem(llvm::vfs::getRealFileSystem());
4646
sourceMgr.AddNewSourceBuffer(std::move(chunkBuffer), SMLoc());
4747

4848
// If we are dumping ODS information, also enable documentation to ensure the

0 commit comments

Comments
 (0)