Commit f03a35f 1 parent 43bc383 commit f03a35f Copy full SHA for f03a35f
File tree 1 file changed +21
-7
lines changed
1 file changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -32,15 +32,29 @@ namespace vast::cg {
32
32
};
33
33
34
34
template < typename Derived >
35
- struct UnsupportedTypeVisitor {
36
- mlir_type Visit (clang::QualType type) {
37
- // TODO
38
- VAST_UNREACHABLE (" unsupported type: {0}" , type.getAsString ());
35
+ struct UnsupportedTypeVisitor
36
+ : clang::TypeVisitor< UnsupportedTypeVisitor< Derived >, mlir_type >
37
+ , CodeGenVisitorLens< UnsupportedTypeVisitor< Derived >, Derived >
38
+ , CodeGenBuilder< UnsupportedTypeVisitor< Derived >, Derived >
39
+ {
40
+ using LensType = CodeGenVisitorLens< UnsupportedTypeVisitor< Derived >, Derived >;
41
+
42
+ using LensType::mcontext;
43
+ using LensType::visit;
44
+
45
+ auto make_unsupported_type (auto ty) {
46
+ return this ->template make_type < us::UnsupportedType >()
47
+ .bind (&mcontext ())
48
+ .bind (ty->getTypeClassName ())
49
+ .freeze ();
39
50
}
40
51
41
- mlir_type Visit (const clang::Type *type) {
42
- // TODO
43
- VAST_UNREACHABLE (" unsupported type: {0}" , type->getTypeClassName ());
52
+ mlir_type Visit (clang::QualType ty) {
53
+ return ty.isNull () ? Type () : Visit (ty.getTypePtr ());
54
+ }
55
+
56
+ mlir_type Visit (const clang_type *ty) {
57
+ return make_unsupported_type (ty);
44
58
}
45
59
};
46
60
You can’t perform that action at this time.
0 commit comments