@@ -55,10 +55,7 @@ clang::TypeInfo CIRLowerContext::getTypeInfoImpl(const Type T) const {
5555 } else if (isa<StructType>(T)) {
5656 typeKind = clang::Type::Record;
5757 } else {
58- cir_assert_or_abort (!::cir::MissingFeatures::ABIClangTypeKind (),
59- " Unhandled type class" );
60- // FIXME(cir): Completely wrong. Just here to make it non-blocking.
61- typeKind = clang::Type::Builtin;
58+ llvm_unreachable (" Unhandled type class" );
6259 }
6360
6461 // FIXME(cir): Here we fetch the width and alignment of a type considering the
@@ -99,10 +96,10 @@ clang::TypeInfo CIRLowerContext::getTypeInfoImpl(const Type T) const {
9996 }
10097 case clang::Type::Record: {
10198 const auto RT = dyn_cast<StructType>(T);
102- cir_tl_assert (!::cir::MissingFeatures::tagTypeClassAbstraction ());
99+ assert (!::cir::MissingFeatures::tagTypeClassAbstraction ());
103100
104101 // Only handle TagTypes (names types) for now.
105- cir_tl_assert (RT.getName () && " Anonymous record is NYI" );
102+ assert (RT.getName () && " Anonymous record is NYI" );
106103
107104 // NOTE(cir): Clang does some hanlding of invalid tagged declarations here.
108105 // Not sure if this is necessary in CIR.
@@ -114,22 +111,22 @@ clang::TypeInfo CIRLowerContext::getTypeInfoImpl(const Type T) const {
114111 const CIRRecordLayout &Layout = getCIRRecordLayout (RT);
115112 Width = toBits (Layout.getSize ());
116113 Align = toBits (Layout.getAlignment ());
117- cir_tl_assert (!::cir::MissingFeatures::recordDeclHasAlignmentAttr ());
114+ assert (!::cir::MissingFeatures::recordDeclHasAlignmentAttr ());
118115 break ;
119116 }
120117 default :
121118 llvm_unreachable (" Unhandled type class" );
122119 }
123120
124- cir_tl_assert (llvm::isPowerOf2_32 (Align) && " Alignment must be power of 2" );
121+ assert (llvm::isPowerOf2_32 (Align) && " Alignment must be power of 2" );
125122 return clang::TypeInfo (Width, Align, AlignRequirement);
126123}
127124
128125Type CIRLowerContext::initBuiltinType (clang::BuiltinType::Kind K) {
129126 Type Ty;
130127
131128 // NOTE(cir): Clang does more stuff here. Not sure if we need to do the same.
132- cir_tl_assert (!::cir::MissingFeatures::qualifiedTypes ());
129+ assert (!::cir::MissingFeatures::qualifiedTypes ());
133130 switch (K) {
134131 case clang::BuiltinType::Char_S:
135132 Ty = IntType::get (getMLIRContext (), 8 , true );
@@ -144,7 +141,7 @@ Type CIRLowerContext::initBuiltinType(clang::BuiltinType::Kind K) {
144141
145142void CIRLowerContext::initBuiltinTypes (const clang::TargetInfo &Target,
146143 const clang::TargetInfo *AuxTarget) {
147- cir_tl_assert ((!this ->Target || this ->Target == &Target) &&
144+ assert ((!this ->Target || this ->Target == &Target) &&
148145 " Incorrect target reinitialization" );
149146 this ->Target = &Target;
150147 this ->AuxTarget = AuxTarget;
0 commit comments