Support parsing MLIR source from stdin.
authorMLIR Team <no-reply@google.com>
Thu, 27 Jun 2019 02:56:42 +0000 (19:56 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 27 Jun 2019 02:57:04 +0000 (19:57 -0700)
PiperOrigin-RevId: 255316118

mlir/lib/Parser/Parser.cpp

index a384145..d244308 100644 (file)
@@ -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);