File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -570,12 +570,19 @@ clang::QualType ClangTypeConverter::visitFunctionType(FunctionType *type) {
570
570
}
571
571
572
572
clang::QualType ClangTypeConverter::visitSILFunctionType (SILFunctionType *type) {
573
- llvm::report_fatal_error (" Expected only AST types but found a SIL function." );
573
+ // We must've already computed it before if applicable.
574
+ return clang::QualType (type->getClangFunctionType (), 0 );
574
575
}
575
576
576
577
clang::QualType
577
578
ClangTypeConverter::visitSILBlockStorageType (SILBlockStorageType *type) {
578
- llvm::report_fatal_error (" Expected only AST types but found a SIL block." );
579
+ // We'll select (void)(^)(). This isn't correct for all blocks, but block
580
+ // storage type should only be converted for function signature lowering,
581
+ // where the parameter types do not matter.
582
+ auto &clangCtx = ClangASTContext;
583
+ auto fnTy = clangCtx.getFunctionNoProtoType (clangCtx.VoidTy );
584
+ auto blockTy = clangCtx.getBlockPointerType (fnTy);
585
+ return clangCtx.getCanonicalType (blockTy);
579
586
}
580
587
581
588
clang::QualType
You can’t perform that action at this time.
0 commit comments