From 1533e531594f5415910ef3cf9b2b8fe8892d60cb Mon Sep 17 00:00:00 2001 From: MLIR Team Date: Wed, 26 Jun 2019 19:56:42 -0700 Subject: [PATCH] Support parsing MLIR source from stdin. PiperOrigin-RevId: 255316118 --- mlir/lib/Parser/Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/lib/Parser/Parser.cpp b/mlir/lib/Parser/Parser.cpp index a384145..d244308 100644 --- a/mlir/lib/Parser/Parser.cpp +++ b/mlir/lib/Parser/Parser.cpp @@ -4166,7 +4166,7 @@ Module *mlir::parseSourceFile(StringRef filename, llvm::SourceMgr &sourceMgr, "only main buffer parsed at the moment"); return nullptr; } - auto file_or_err = llvm::MemoryBuffer::getFile(filename); + auto file_or_err = llvm::MemoryBuffer::getFileOrSTDIN(filename); if (std::error_code error = file_or_err.getError()) { emitError(mlir::UnknownLoc::get(context), "could not open input file " + filename); -- 2.7.4