MLIR  16.0.0git
Macros | Functions
Wrap.h File Reference
#include "mlir-c/IR.h"
#include "mlir/Support/LLVM.h"
+ Include dependency graph for Wrap.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEFINE_C_API_PTR_METHODS(name, cpptype)
 
#define DEFINE_C_API_METHODS(name, cpptype)
 

Functions

template<typename CppTy , typename CTy >
static llvm::ArrayRef< CppTy > unwrapList (size_t size, CTy *first, llvm::SmallVectorImpl< CppTy > &storage)
 

Macro Definition Documentation

◆ DEFINE_C_API_METHODS

#define DEFINE_C_API_METHODS (   name,
  cpptype 
)
Value:
static inline name wrap(cpptype cpp) { \
return name{cpp.getAsOpaquePointer()}; \
} \
static inline cpptype unwrap(name c) { \
return cpptype::getFromOpaquePointer(c.ptr); \
}
MlirDiagnostic wrap(mlir::Diagnostic &diagnostic)
Definition: Diagnostics.h:24
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
Definition: Diagnostics.h:19

Definition at line 31 of file Wrap.h.

◆ DEFINE_C_API_PTR_METHODS

#define DEFINE_C_API_PTR_METHODS (   name,
  cpptype 
)
Value:
static inline name wrap(cpptype *cpp) { return name{cpp}; } \
static inline cpptype *unwrap(name c) { \
return static_cast<cpptype *>(c.ptr); \
}
MlirDiagnostic wrap(mlir::Diagnostic &diagnostic)
Definition: Diagnostics.h:24
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
Definition: Diagnostics.h:19

Definition at line 25 of file Wrap.h.

Referenced by mlirParsePassPipeline().

Function Documentation

◆ unwrapList()

template<typename CppTy , typename CTy >
static llvm::ArrayRef<CppTy> unwrapList ( size_t  size,
CTy *  first,
llvm::SmallVectorImpl< CppTy > &  storage 
)
static