@@ -55,8 +55,8 @@ clang::TypeInfo CIRLowerContext::getTypeInfoImpl(const Type T) const {
55
55
} else if (isa<StructType>(T)) {
56
56
typeKind = clang::Type::Record;
57
57
} else {
58
- cir_assert_or_abort (!::cir::MissingFeatures::ABIClangTypeKind (),
59
- " Unhandled type class" );
58
+ cir_cconv_assert_or_abort (!::cir::MissingFeatures::ABIClangTypeKind (),
59
+ " Unhandled type class" );
60
60
// FIXME(cir): Completely wrong. Just here to make it non-blocking.
61
61
typeKind = clang::Type::Builtin;
62
62
}
@@ -94,48 +94,49 @@ clang::TypeInfo CIRLowerContext::getTypeInfoImpl(const Type T) const {
94
94
Align = Target->getDoubleAlign ();
95
95
break ;
96
96
}
97
- cir_unreachable (" Unknown builtin type!" );
97
+ cir_cconv_unreachable (" Unknown builtin type!" );
98
98
break ;
99
99
}
100
100
case clang::Type::Record: {
101
101
const auto RT = dyn_cast<StructType>(T);
102
- cir_tl_assert (!::cir::MissingFeatures::tagTypeClassAbstraction ());
102
+ cir_cconv_assert (!::cir::MissingFeatures::tagTypeClassAbstraction ());
103
103
104
104
// Only handle TagTypes (names types) for now.
105
- cir_tl_assert (RT.getName () && " Anonymous record is NYI" );
105
+ cir_cconv_assert (RT.getName () && " Anonymous record is NYI" );
106
106
107
107
// NOTE(cir): Clang does some hanlding of invalid tagged declarations here.
108
108
// Not sure if this is necessary in CIR.
109
109
110
110
if (::cir::MissingFeatures::typeGetAsEnumType ()) {
111
- cir_unreachable (" NYI" );
111
+ cir_cconv_unreachable (" NYI" );
112
112
}
113
113
114
114
const CIRRecordLayout &Layout = getCIRRecordLayout (RT);
115
115
Width = toBits (Layout.getSize ());
116
116
Align = toBits (Layout.getAlignment ());
117
- cir_tl_assert (!::cir::MissingFeatures::recordDeclHasAlignmentAttr ());
117
+ cir_cconv_assert (!::cir::MissingFeatures::recordDeclHasAlignmentAttr ());
118
118
break ;
119
119
}
120
120
default :
121
- cir_unreachable (" Unhandled type class" );
121
+ cir_cconv_unreachable (" Unhandled type class" );
122
122
}
123
123
124
- cir_tl_assert (llvm::isPowerOf2_32 (Align) && " Alignment must be power of 2" );
124
+ cir_cconv_assert (llvm::isPowerOf2_32 (Align) &&
125
+ " Alignment must be power of 2" );
125
126
return clang::TypeInfo (Width, Align, AlignRequirement);
126
127
}
127
128
128
129
Type CIRLowerContext::initBuiltinType (clang::BuiltinType::Kind K) {
129
130
Type Ty;
130
131
131
132
// NOTE(cir): Clang does more stuff here. Not sure if we need to do the same.
132
- cir_tl_assert (!::cir::MissingFeatures::qualifiedTypes ());
133
+ cir_cconv_assert (!::cir::MissingFeatures::qualifiedTypes ());
133
134
switch (K) {
134
135
case clang::BuiltinType::Char_S:
135
136
Ty = IntType::get (getMLIRContext (), 8 , true );
136
137
break ;
137
138
default :
138
- cir_unreachable (" NYI" );
139
+ cir_cconv_unreachable (" NYI" );
139
140
}
140
141
141
142
Types.push_back (Ty);
@@ -144,16 +145,16 @@ Type CIRLowerContext::initBuiltinType(clang::BuiltinType::Kind K) {
144
145
145
146
void CIRLowerContext::initBuiltinTypes (const clang::TargetInfo &Target,
146
147
const clang::TargetInfo *AuxTarget) {
147
- cir_tl_assert ((!this ->Target || this ->Target == &Target) &&
148
- " Incorrect target reinitialization" );
148
+ cir_cconv_assert ((!this ->Target || this ->Target == &Target) &&
149
+ " Incorrect target reinitialization" );
149
150
this ->Target = &Target;
150
151
this ->AuxTarget = AuxTarget;
151
152
152
153
// C99 6.2.5p3.
153
154
if (LangOpts.CharIsSigned )
154
155
CharTy = initBuiltinType (clang::BuiltinType::Char_S);
155
156
else
156
- cir_unreachable (" NYI" );
157
+ cir_cconv_unreachable (" NYI" );
157
158
}
158
159
159
160
// / Convert a size in bits to a size in characters.
@@ -168,7 +169,7 @@ int64_t CIRLowerContext::toBits(clang::CharUnits CharSize) const {
168
169
169
170
clang::TypeInfoChars CIRLowerContext::getTypeInfoInChars (Type T) const {
170
171
if (auto arrTy = dyn_cast<ArrayType>(T))
171
- cir_unreachable (" NYI" );
172
+ cir_cconv_unreachable (" NYI" );
172
173
clang::TypeInfo Info = getTypeInfo (T);
173
174
return clang::TypeInfoChars (toCharUnitsFromBits (Info.Width ),
174
175
toCharUnitsFromBits (Info.Align ),
@@ -179,7 +180,7 @@ bool CIRLowerContext::isPromotableIntegerType(Type T) const {
179
180
// HLSL doesn't promote all small integer types to int, it
180
181
// just uses the rank-based promotion rules for all types.
181
182
if (::cir::MissingFeatures::langOpts ())
182
- cir_unreachable (" NYI" );
183
+ cir_cconv_unreachable (" NYI" );
183
184
184
185
// FIXME(cir): CIR does not distinguish between char, short, etc. So we just
185
186
// assume it is promotable if smaller than 32 bits. This is wrong since, for
@@ -198,7 +199,7 @@ bool CIRLowerContext::isPromotableIntegerType(Type T) const {
198
199
// TODO(cir): CIR doesn't know if a integer originated from an enum. Improve
199
200
// CIR or add an AST query here.
200
201
if (::cir::MissingFeatures::typeGetAsEnumType ()) {
201
- cir_unreachable (" NYI" );
202
+ cir_cconv_unreachable (" NYI" );
202
203
}
203
204
204
205
return false ;
0 commit comments