Skip to content

Commit 97eacf7

Browse files
committed
cg: Propagate unsupported type to lower visitors.
1 parent f03a35f commit 97eacf7

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

include/vast/CodeGen/CodeGenTypeVisitor.hpp

+10-7
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,7 @@ namespace vast::cg {
248248
return VisitTypeOfType(t, quals);
249249
}
250250

251-
ty.dump();
252-
VAST_UNREACHABLE("unsupported qualified type");
253-
return Type{};
251+
return {};
254252
}
255253

256254
auto VisitElaboratedType(const clang::ElaboratedType *ty, qualifiers quals) -> mlir_type {
@@ -274,7 +272,6 @@ namespace vast::cg {
274272
}
275273
}
276274

277-
278275
auto *mctx = &mcontext();
279276
if (ty->getReturnType()->isVoidType()) {
280277
return mlir::FunctionType::get(mctx, args, {});
@@ -481,12 +478,18 @@ namespace vast::cg {
481478
}
482479

483480
auto Visit(const clang_type *ty) -> mlir_type {
484-
return StoreDataLayout(ty, Base::Visit(ty));
481+
if (auto gen = Base::Visit(ty)) {
482+
return StoreDataLayout(ty, gen);
483+
}
484+
return {};
485485
}
486486

487487
auto Visit(clang::QualType ty) -> mlir_type {
488-
auto [underlying, quals] = ty.split();
489-
return StoreDataLayout(underlying, Base::Visit(ty));
488+
if (auto gen = Base::Visit(ty)) {
489+
auto [underlying, quals] = ty.split();
490+
return StoreDataLayout(underlying, gen);
491+
}
492+
return {};
490493
}
491494
};
492495

0 commit comments

Comments
 (0)