MLIR  20.0.0git
Public Types | Static Public Member Functions | List of all members
mlir::detail::TypeIDResolver< T, Enable > Class Template Reference

This class provides a resolver for getting the ID for a given class T. More...

#include "mlir/Support/TypeID.h"

+ Inheritance diagram for mlir::detail::TypeIDResolver< T, Enable >:

Public Types

template<typename U >
using is_fully_resolved_trait = decltype(sizeof(U))
 Trait to check if U is fully resolved. More...
 
template<typename U >
using is_fully_resolved = llvm::is_detected< is_fully_resolved_trait, U >
 

Static Public Member Functions

static TypeID resolveTypeID ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from mlir::detail::FallbackTypeIDResolver
static TypeID registerImplicitTypeID (StringRef name)
 Register an implicit type ID for the given type name. More...
 

Detailed Description

template<typename T, typename Enable = void>
class mlir::detail::TypeIDResolver< T, Enable >

This class provides a resolver for getting the ID for a given class T.

This allows for the derived type to specialize its resolution behavior. The default implementation uses the string name of the type to resolve the ID. This provides a strong definition, but at the cost of performance (we need to do an initial lookup) and is not usable by classes defined in anonymous contexts.

TODO: The use of the type name is only necessary when building in the presence of shared libraries. We could add a build flag that guarantees "static"-like environments and switch this to a more optimal implementation when that is enabled.

Definition at line 179 of file TypeID.h.

Member Typedef Documentation

◆ is_fully_resolved

template<typename T , typename Enable = void>
template<typename U >
using mlir::detail::TypeIDResolver< T, Enable >::is_fully_resolved = llvm::is_detected<is_fully_resolved_trait, U>

Definition at line 190 of file TypeID.h.

◆ is_fully_resolved_trait

template<typename T , typename Enable = void>
template<typename U >
using mlir::detail::TypeIDResolver< T, Enable >::is_fully_resolved_trait = decltype(sizeof(U))

Trait to check if U is fully resolved.

We use this to verify that T is fully resolved when trying to resolve a TypeID. We don't technically need to have the full definition of T for the fallback, but it does help prevent situations where a forward declared type uses this fallback even though there is a strong definition for the TypeID in the location where T is defined.

Definition at line 188 of file TypeID.h.

Member Function Documentation

◆ resolveTypeID()

template<typename T , typename Enable = void>
static TypeID mlir::detail::TypeIDResolver< T, Enable >::resolveTypeID ( )
inlinestatic

The documentation for this class was generated from the following file: