@@ -35,73 +35,73 @@ using TypeBuilderFunc = mlir::Type (*)(mlir::MLIRContext *);
35
35
36
36
// / Get the LLVM IR dialect model for building a particular C++ type, `T`.
37
37
template <typename T>
38
- TypeBuilderFunc getModel ();
38
+ static TypeBuilderFunc getModel ();
39
39
40
40
template <>
41
- TypeBuilderFunc getModel<void *>() {
41
+ constexpr TypeBuilderFunc getModel<void *>() {
42
42
return [](mlir::MLIRContext *context) -> mlir::Type {
43
43
return mlir::LLVM::LLVMPointerType::get (context);
44
44
};
45
45
}
46
46
template <>
47
- TypeBuilderFunc getModel<unsigned >() {
47
+ constexpr TypeBuilderFunc getModel<unsigned >() {
48
48
return [](mlir::MLIRContext *context) -> mlir::Type {
49
49
return mlir::IntegerType::get (context, sizeof (unsigned ) * 8 );
50
50
};
51
51
}
52
52
template <>
53
- TypeBuilderFunc getModel<int >() {
53
+ constexpr TypeBuilderFunc getModel<int >() {
54
54
return [](mlir::MLIRContext *context) -> mlir::Type {
55
55
return mlir::IntegerType::get (context, sizeof (int ) * 8 );
56
56
};
57
57
}
58
58
template <>
59
- TypeBuilderFunc getModel<unsigned long >() {
59
+ constexpr TypeBuilderFunc getModel<unsigned long >() {
60
60
return [](mlir::MLIRContext *context) -> mlir::Type {
61
61
return mlir::IntegerType::get (context, sizeof (unsigned long ) * 8 );
62
62
};
63
63
}
64
64
template <>
65
- TypeBuilderFunc getModel<unsigned long long >() {
65
+ constexpr TypeBuilderFunc getModel<unsigned long long >() {
66
66
return [](mlir::MLIRContext *context) -> mlir::Type {
67
67
return mlir::IntegerType::get (context, sizeof (unsigned long long ) * 8 );
68
68
};
69
69
}
70
70
template <>
71
- TypeBuilderFunc getModel<long long >() {
71
+ constexpr TypeBuilderFunc getModel<long long >() {
72
72
return [](mlir::MLIRContext *context) -> mlir::Type {
73
73
return mlir::IntegerType::get (context, sizeof (long long ) * 8 );
74
74
};
75
75
}
76
76
template <>
77
- TypeBuilderFunc getModel<Fortran::ISO::CFI_rank_t>() {
77
+ constexpr TypeBuilderFunc getModel<Fortran::ISO::CFI_rank_t>() {
78
78
return [](mlir::MLIRContext *context) -> mlir::Type {
79
79
return mlir::IntegerType::get (context,
80
80
sizeof (Fortran::ISO::CFI_rank_t) * 8 );
81
81
};
82
82
}
83
83
template <>
84
- TypeBuilderFunc getModel<Fortran::ISO::CFI_type_t>() {
84
+ constexpr TypeBuilderFunc getModel<Fortran::ISO::CFI_type_t>() {
85
85
return [](mlir::MLIRContext *context) -> mlir::Type {
86
86
return mlir::IntegerType::get (context,
87
87
sizeof (Fortran::ISO::CFI_type_t) * 8 );
88
88
};
89
89
}
90
90
template <>
91
- TypeBuilderFunc getModel<long >() {
91
+ constexpr TypeBuilderFunc getModel<long >() {
92
92
return [](mlir::MLIRContext *context) -> mlir::Type {
93
93
return mlir::IntegerType::get (context, sizeof (long ) * 8 );
94
94
};
95
95
}
96
96
template <>
97
- TypeBuilderFunc getModel<Fortran::ISO::CFI_dim_t>() {
97
+ constexpr TypeBuilderFunc getModel<Fortran::ISO::CFI_dim_t>() {
98
98
return [](mlir::MLIRContext *context) -> mlir::Type {
99
99
auto indexTy = getModel<Fortran::ISO::CFI_index_t>()(context);
100
100
return mlir::LLVM::LLVMArrayType::get (indexTy, 3 );
101
101
};
102
102
}
103
103
template <>
104
- TypeBuilderFunc
104
+ constexpr TypeBuilderFunc
105
105
getModel<Fortran::ISO::cfi_internal::FlexibleArray<Fortran::ISO::CFI_dim_t>>() {
106
106
return getModel<Fortran::ISO::CFI_dim_t>();
107
107
}
0 commit comments