My Project
ToolUtilities.h
Go to the documentation of this file.
1 //===- ToolUtilities.h - MLIR Tool Utilities --------------------*- 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 // This file declares common utilities for implementing MLIR tools.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_SUPPORT_TOOLUTILITIES_H
14 #define MLIR_SUPPORT_TOOLUTILITIES_H
15 
16 #include "mlir/Support/LLVM.h"
17 #include "llvm/ADT/STLExtras.h"
18 #include <memory>
19 
20 namespace llvm {
21 class MemoryBuffer;
22 }
23 
24 namespace mlir {
25 struct LogicalResult;
26 
27 using ChunkBufferHandler = function_ref<LogicalResult(
28  std::unique_ptr<llvm::MemoryBuffer> chunkBuffer, raw_ostream &os)>;
29 
37 splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer> originalBuffer,
38  ChunkBufferHandler processChunkBuffer, raw_ostream &os);
39 } // namespace mlir
40 
41 #endif // MLIR_SUPPORT_TOOLUTILITIES_H
Definition: InferTypeOpInterface.cpp:20
Definition: PassRegistry.cpp:413
llvm::function_ref< Fn > function_ref
Definition: LLVM.h:76
Definition: LLVM.h:49
Definition: LogicalResult.h:18
LogicalResult splitAndProcessBuffer(std::unique_ptr< llvm::MemoryBuffer > originalBuffer, ChunkBufferHandler processChunkBuffer, raw_ostream &os)
Definition: ToolUtilities.cpp:21
function_ref< LogicalResult(std::unique_ptr< llvm::MemoryBuffer > chunkBuffer, raw_ostream &os)> ChunkBufferHandler
Definition: ToolUtilities.h:28