My Project
FileUtilities.h
Go to the documentation of this file.
1 //===- FileUtilities.h - utilities for working with files -------*- C++ -*-===//
2 //
3 // Part of the MLIR Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Common utilities for working with files.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_SUPPORT_FILEUTILITIES_H_
14 #define MLIR_SUPPORT_FILEUTILITIES_H_
15 
16 #include <memory>
17 #include <string>
18 
19 namespace llvm {
20 class MemoryBuffer;
21 class ToolOutputFile;
22 class StringRef;
23 } // namespace llvm
24 
25 namespace mlir {
26 
29 std::unique_ptr<llvm::MemoryBuffer>
30 openInputFile(llvm::StringRef inputFilename,
31  std::string *errorMessage = nullptr);
32 
35 std::unique_ptr<llvm::ToolOutputFile>
36 openOutputFile(llvm::StringRef outputFilename,
37  std::string *errorMessage = nullptr);
38 
39 } // namespace mlir
40 
41 #endif // MLIR_SUPPORT_FILEUTILITIES_H_
Definition: InferTypeOpInterface.cpp:20
Definition: PassRegistry.cpp:413
std::unique_ptr< llvm::ToolOutputFile > openOutputFile(llvm::StringRef outputFilename, std::string *errorMessage=nullptr)
std::unique_ptr< llvm::MemoryBuffer > openInputFile(llvm::StringRef inputFilename, std::string *errorMessage=nullptr)