9 #ifndef MLIR_DIALECT_SPARSETENSOR_IR_DETAIL_TEMPLATEEXTRAS_H
10 #define MLIR_DIALECT_SPARSETENSOR_IR_DETAIL_TEMPLATEEXTRAS_H
14 #include "llvm/ADT/STLExtras.h"
15 #include "llvm/Support/raw_ostream.h"
18 namespace sparse_tensor {
24 decltype(std::declval<T>().
print(std::declval<llvm::raw_ostream &>()));
27 template <
typename T,
typename R =
void>
29 std::enable_if_t<detect_has_print_method<T>::value, R>;
35 operator<<(llvm::raw_ostream &os, T
const &t) {
44 std::is_trivially_copyable_v<T> && std::is_trivially_destructible_v<T> &&
46 std::is_standard_layout_v<T> &&
49 std::is_trivially_copy_constructible<T>::value &&
50 std::is_trivially_move_constructible<T>::value;
static void print(spirv::VerCapExtAttr triple, DialectAsmPrinter &printer)
decltype(std::declval< T >().print(std::declval< llvm::raw_ostream & >())) has_print_method
enable_if_has_print_method< T, llvm::raw_ostream & > operator<<(llvm::raw_ostream &os, T const &t)
Generic template for defining operator<< overloads which delegate to T::print(raw_ostream&) const.
llvm::is_detected< has_print_method, T > detect_has_print_method
std::enable_if_t< detect_has_print_method< T >::value, R > enable_if_has_print_method
static constexpr bool IsZeroCostAbstraction
Include the generated interface declarations.