1 | //===- CppEmitter.h - Helpers to create C++ emitter -------------*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM 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 defines helpers to emit C++ code using the EmitC dialect. |
10 | // |
11 | //===----------------------------------------------------------------------===// |
12 | |
13 | #ifndef MLIR_TARGET_CPP_CPPEMITTER_H |
14 | #define MLIR_TARGET_CPP_CPPEMITTER_H |
15 | |
16 | #include "mlir/Support/LLVM.h" |
17 | |
18 | namespace mlir { |
19 | struct LogicalResult; |
20 | class Operation; |
21 | namespace emitc { |
22 | |
23 | /// Translates the given operation to C++ code. The operation or operations in |
24 | /// the region of 'op' need almost all be in EmitC dialect. The parameter |
25 | /// 'declareVariablesAtTop' enforces that all variables for op results and block |
26 | /// arguments are declared at the beginning of the function. |
27 | LogicalResult translateToCpp(Operation *op, raw_ostream &os, |
28 | bool declareVariablesAtTop = false); |
29 | } // namespace emitc |
30 | } // namespace mlir |
31 | |
32 | #endif // MLIR_TARGET_CPP_CPPEMITTER_H |
33 | |