#include "mlir/Support/LLVM.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
#include "llvm/Support/TypeName.h"
Go to the source code of this file.
◆ MLIR_DECLARE_EXPLICIT_FALLBACK_TYPE_ID
#define MLIR_DECLARE_EXPLICIT_FALLBACK_TYPE_ID |
( |
|
CLASS_NAME | ) |
|
Value:
namespace detail { \
template <> \
class TypeIDResolver<CLASS_NAME> : public FallbackTypeIDResolver { \
public: \
static TypeID resolveTypeID() { \
static_assert(is_fully_resolved<CLASS_NAME>(), \
"TypeID::get<> requires the complete definition of `T`"); \
static TypeID id = \
registerImplicitTypeID(llvm::getTypeName<CLASS_NAME>()); \
return id; \
} \
}; \
} \
}
Include the generated interface declarations.
Declare/define an explicit specialization for TypeID using the string comparison fallback.
This is useful for complex shared library setups where it may be difficult to agree on a source of truth for specific type ID resolution. As long as there is a single resolution for registerImplicitTypeID, all type IDs can be reference a shared registration. This way types which are logically shared across multiple DSOs can have the same type ID, even if their definitions are duplicated.
Definition at line 291 of file TypeID.h.
◆ MLIR_DECLARE_EXPLICIT_SELF_OWNING_TYPE_ID
#define MLIR_DECLARE_EXPLICIT_SELF_OWNING_TYPE_ID |
( |
|
CLASS_NAME | ) |
|
Value:
namespace detail { \
template <> \
class TypeIDResolver<CLASS_NAME> { \
public: \
static TypeID resolveTypeID() { return id; } \
\
private: \
static SelfOwningTypeID id; \
}; \
} \
}
Definition at line 262 of file TypeID.h.
◆ MLIR_DECLARE_EXPLICIT_TYPE_ID
◆ MLIR_DEFINE_EXPLICIT_FALLBACK_TYPE_ID
#define MLIR_DEFINE_EXPLICIT_FALLBACK_TYPE_ID |
( |
|
CLASS_NAME | ) |
|
◆ MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID
#define MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID |
( |
|
CLASS_NAME | ) |
|
Value: static ::mlir::TypeID resolveTypeID() { \
static ::mlir::SelfOwningTypeID id; \
return id; \
} \
static_assert( \
CLASS_NAME>::value, \
"`MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID` must be placed in a " \
"public section of `" #CLASS_NAME "`");
llvm::is_detected< has_resolve_typeid_trait, T > has_resolve_typeid
Definition at line 331 of file TypeID.h.
◆ MLIR_DEFINE_EXPLICIT_SELF_OWNING_TYPE_ID
#define MLIR_DEFINE_EXPLICIT_SELF_OWNING_TYPE_ID |
( |
|
CLASS_NAME | ) |
|
Value:
namespace detail { \
SelfOwningTypeID TypeIDResolver<CLASS_NAME>::id = {}; \
} \
}
Definition at line 276 of file TypeID.h.
◆ MLIR_DEFINE_EXPLICIT_TYPE_ID
◆ MLIR_USE_FALLBACK_TYPE_IDS
#define MLIR_USE_FALLBACK_TYPE_IDS false |