MLIR  20.0.0git
Macros | Functions
Wrap.h File Reference
#include "mlir-c/IR.h"
#include "mlir/Support/LLVM.h"

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); \
}
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
Definition: Diagnostics.h:19
MlirDiagnostic wrap(mlir::Diagnostic &diagnostic)
Definition: Diagnostics.h:24

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); \
}

Definition at line 25 of file Wrap.h.

Function Documentation

◆ unwrapList()

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