MLIR  20.0.0git
FuncOps.h
Go to the documentation of this file.
1 //===- FuncOps.h - Func Dialect Operations ----------------------*- 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 #ifndef MLIR_DIALECT_FUNC_IR_OPS_H
10 #define MLIR_DIALECT_FUNC_IR_OPS_H
11 
13 #include "mlir/IR/Builders.h"
14 #include "mlir/IR/BuiltinTypes.h"
15 #include "mlir/IR/Dialect.h"
17 #include "mlir/IR/SymbolTable.h"
23 
24 namespace mlir {
25 class PatternRewriter;
26 } // namespace mlir
27 
28 #define GET_OP_CLASSES
29 #include "mlir/Dialect/Func/IR/FuncOps.h.inc"
30 
31 #include "mlir/Dialect/Func/IR/FuncOpsDialect.h.inc"
32 
33 namespace llvm {
34 
35 /// Allow stealing the low bits of FuncOp.
36 template <>
37 struct PointerLikeTypeTraits<mlir::func::FuncOp> {
38  static inline void *getAsVoidPointer(mlir::func::FuncOp val) {
39  return const_cast<void *>(val.getAsOpaquePointer());
40  }
41  static inline mlir::func::FuncOp getFromVoidPointer(void *p) {
42  return mlir::func::FuncOp::getFromOpaquePointer(p);
43  }
44  static constexpr int numLowBitsAvailable = 3;
45 };
46 } // namespace llvm
47 
48 #endif // MLIR_DIALECT_FUNC_IR_OPS_H
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Definition: CallGraph.h:229
Include the generated interface declarations.
static mlir::func::FuncOp getFromVoidPointer(void *p)
Definition: FuncOps.h:41
static void * getAsVoidPointer(mlir::func::FuncOp val)
Definition: FuncOps.h:38