MLIR  20.0.0git
Classes | Macros | Typedefs
Registration.h File Reference
#include "mlir-c/IR.h"
#include "mlir/CAPI/IR.h"
#include "mlir/CAPI/Support.h"

Go to the source code of this file.

Classes

struct  MlirDialectRegistrationHooks
 Structure of dialect registration hooks. More...
 

Macros

#define MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Name, Namespace, ClassName)
 

Typedefs

typedef void(* MlirDialectRegistryInsertDialectHook) (MlirDialectRegistry registry)
 Hooks for dynamic discovery of dialects. More...
 
typedef MlirDialect(* MlirContextLoadDialectHook) (MlirContext context)
 
typedef MlirStringRef(* MlirDialectGetNamespaceHook) ()
 
typedef struct MlirDialectRegistrationHooks MlirDialectRegistrationHooks
 

Macro Definition Documentation

◆ MLIR_DEFINE_CAPI_DIALECT_REGISTRATION

#define MLIR_DEFINE_CAPI_DIALECT_REGISTRATION (   Name,
  Namespace,
  ClassName 
)
Value:
static void mlirDialectRegistryInsert##Name##Dialect( \
MlirDialectRegistry registry) { \
unwrap(registry)->insert<ClassName>(); \
} \
static MlirDialect mlirContextLoad##Name##Dialect(MlirContext context) { \
return wrap(unwrap(context)->getOrLoadDialect<ClassName>()); \
} \
static MlirStringRef mlir##Name##DialectGetNamespace() { \
return wrap(ClassName::getDialectNamespace()); \
} \
MlirDialectHandle mlirGetDialectHandle__##Namespace##__() { \
static MlirDialectRegistrationHooks hooks = { \
mlirDialectRegistryInsert##Name##Dialect, \
mlirContextLoad##Name##Dialect, mlir##Name##DialectGetNamespace}; \
return MlirDialectHandle{&hooks}; \
}
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
Definition: Diagnostics.h:19
MlirDiagnostic wrap(mlir::Diagnostic &diagnostic)
Definition: Diagnostics.h:24
Include the generated interface declarations.
Structure of dialect registration hooks.
Definition: Registration.h:29
A pointer to a sized fragment of a string, not necessarily null-terminated.
Definition: Support.h:73

Definition at line 36 of file Registration.h.

Typedef Documentation

◆ MlirContextLoadDialectHook

typedef MlirDialect(* MlirContextLoadDialectHook) (MlirContext context)

Definition at line 25 of file Registration.h.

◆ MlirDialectGetNamespaceHook

typedef MlirStringRef(* MlirDialectGetNamespaceHook) ()

Definition at line 26 of file Registration.h.

◆ MlirDialectRegistrationHooks

Definition at line 26 of file Registration.h.

◆ MlirDialectRegistryInsertDialectHook

typedef void(* MlirDialectRegistryInsertDialectHook) (MlirDialectRegistry registry)

Hooks for dynamic discovery of dialects.

Definition at line 23 of file Registration.h.