MLIR
20.0.0git
|
This class provides a resolver for getting the ID for a given class T. More...
#include "mlir/Support/TypeID.h"
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... | |
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.
using mlir::detail::TypeIDResolver< T, Enable >::is_fully_resolved = llvm::is_detected<is_fully_resolved_trait, 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.
|
inlinestatic |
Definition at line 192 of file TypeID.h.
References mlir::detail::FallbackTypeIDResolver::registerImplicitTypeID().
Referenced by mlir::TypeID::get().