Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions include/swift/AST/Builtins.def
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ BUILTIN_CAST_OR_BITCAST_OPERATION(TruncOrBitCast, "truncOrBitCast", "n")
BUILTIN_CAST_OR_BITCAST_OPERATION(ZExtOrBitCast, "zextOrBitCast", "n")
BUILTIN_CAST_OR_BITCAST_OPERATION(SExtOrBitCast, "sextOrBitCast", "n")

BUILTIN(WasmRefNullExtern, "wasmRefNullExtern", "n")
BUILTIN(WasmTableSizeExternRef, "wasmTableSizeExternRef", "")
BUILTIN(WasmTableGetExternRef, "wasmTableGetExternRef", "")
BUILTIN(WasmTableSetExternRef, "wasmTableSetExternRef", "")
BUILTIN(WasmTableGrowExternRef, "wasmTableGrowExternRef", "")
BUILTIN(WasmTableFillExternRef, "wasmTableFillExternRef", "")
BUILTIN(WasmTableCopyExternRef, "wasmTableCopyExternRef", "")

/// Binary operations have type (T,T) -> T.
///
/// We define two different sorts of operations varying when T is static,
Expand Down
36 changes: 36 additions & 0 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,12 @@ ERROR(expr_keypath_noncopyable_type,none,
"key path cannot refer to noncopyable type %0", (Type))
ERROR(expr_keypath_nonescapable_type,none,
"key path cannot refer to nonescapable type %0", (Type))
ERROR(expr_inout_wasm_externref,none,
"cannot pass value of type %0 as 'inout'; WebAssembly references are not addressable",
(Type))
ERROR(expr_inout_wasm_table,none,
"cannot pass value of type %0 as 'inout'; WebAssembly tables are not addressable",
(Type))
ERROR(expr_keypath_not_property,none,
"%select{key path|dynamic key path member lookup}1 cannot refer to %kind0",
(const ValueDecl *, bool))
Expand Down Expand Up @@ -5205,6 +5211,12 @@ ERROR(capture_across_type_decl,none,
"%kindonly0 declaration cannot close over value %base1 defined in outer "
"scope",
(const NominalTypeDecl *, const ValueDecl *))
ERROR(capture_wasm_externref,none,
"cannot capture value of type %0; WebAssembly references cannot be stored in closure contexts",
(Type))
ERROR(capture_wasm_table,none,
"cannot capture value of type %0; WebAssembly tables cannot be stored in closure contexts",
(Type))

ERROR(isolated_any_conversion_to_synchronous_func,none,
"converting @isolated(any) function of type %0 to synchronous function type %1 is not allowed",
Expand Down Expand Up @@ -6385,6 +6397,30 @@ ERROR(recursive_enum_not_indirect,none,
"recursive enum %0 is not marked 'indirect'", (Type))
ERROR(unsupported_infinitely_sized_type,none,
"value type %0 has infinite size", (Type))
ERROR(wasm_externref_pointer_type,none,
"type %0 cannot contain a pointer to a WebAssembly reference",
(Type))
ERROR(wasm_table_pointer_type,none,
"type %0 cannot contain a pointer to a WebAssembly table",
(Type))
ERROR(wasm_externref_storage,none,
"%select{stored property|static property|global variable}0 cannot have type %1; WebAssembly references cannot be stored in Swift memory",
(unsigned, Type))
ERROR(wasm_table_storage,none,
"%select{local variable|stored property|static property|global variable}0 cannot have type %1; WebAssembly tables are not Swift values",
(unsigned, Type))
ERROR(wasm_externref_variadic,none,
"parameter %0 cannot be variadic because type %1 contains a WebAssembly reference",
(Identifier, Type))
ERROR(wasm_externref_inout_parameter,none,
"'inout' parameter %0 cannot have type %1; WebAssembly references are not addressable",
(Identifier, Type))
ERROR(wasm_table_parameter,none,
"parameter %0 cannot have type %1; WebAssembly tables cannot be passed as Swift values",
(Identifier, Type))
ERROR(wasm_table_result_type,none,
"result type %0 cannot contain a WebAssembly table",
(Type))
NOTE(note_type_cycle_starts_here,none,
"cycle beginning here: %0", (StringRef))
NOTE(note_recursive_enum_case_here,none,
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/KnownStdlibTypes.def
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ KNOWN_STDLIB_TYPE_DECL(UnsafeRawPointer, NominalTypeDecl, 0)
KNOWN_STDLIB_TYPE_DECL(UnsafeMutablePointer, NominalTypeDecl, 1)
KNOWN_STDLIB_TYPE_DECL(UnsafePointer, NominalTypeDecl, 1)
KNOWN_STDLIB_TYPE_DECL(OpaquePointer, NominalTypeDecl, 0)
KNOWN_STDLIB_TYPE_DECL(WasmExternref, NominalTypeDecl, 0)
KNOWN_STDLIB_TYPE_DECL(WasmExternrefTable, NominalTypeDecl, 0)
KNOWN_STDLIB_TYPE_DECL(CVaListPointer, NominalTypeDecl, 0)
KNOWN_STDLIB_TYPE_DECL(AutoreleasingUnsafeMutablePointer, NominalTypeDecl, 1)

Expand Down
6 changes: 5 additions & 1 deletion include/swift/AST/TypeNodes.def
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ ABSTRACT_TYPE(Builtin, Type)
BUILTIN_CONCRETE_TYPE(BuiltinJob, BuiltinType)
BUILTIN_CONCRETE_TYPE(BuiltinPackIndex, BuiltinType)
BUILTIN_CONCRETE_TYPE(BuiltinRawPointer, BuiltinType)
BUILTIN_CONCRETE_TYPE(BuiltinWasmExternRef, BuiltinType)
BUILTIN_CONCRETE_TYPE(BuiltinRawUnsafeContinuation, BuiltinType)
BUILTIN_CONCRETE_TYPE(BuiltinNativeObject, BuiltinType)
BUILTIN_CONCRETE_TYPE(BuiltinBridgeObject, BuiltinType)
Expand All @@ -147,7 +148,8 @@ ABSTRACT_TYPE(Builtin, Type)
TYPE_RANGE(BuiltinGeneric, BuiltinFixedArray, BuiltinBorrow)
BUILTIN_CONCRETE_TYPE(BuiltinUnboundGeneric, BuiltinType)
BUILTIN_CONCRETE_TYPE(BuiltinImplicitActor, BuiltinType)
TYPE_RANGE(Builtin, BuiltinInteger, BuiltinImplicitActor)
BUILTIN_CONCRETE_TYPE(BuiltinWasmExternRefTable, BuiltinType)
TYPE_RANGE(Builtin, BuiltinInteger, BuiltinWasmExternRefTable)
TYPE(Tuple, Type)
ABSTRACT_TYPE(ReferenceStorage, Type)
#define REF_STORAGE(Name, ...) \
Expand Down Expand Up @@ -236,6 +238,8 @@ SINGLETON_TYPE(Job, BuiltinJob)
SINGLETON_TYPE(Executor, BuiltinExecutor)
SINGLETON_TYPE(PackIndex, BuiltinPackIndex)
SINGLETON_TYPE(RawPointer, BuiltinRawPointer)
SINGLETON_TYPE(WasmExternRef, BuiltinWasmExternRef)
SINGLETON_TYPE(WasmExternRefTable, BuiltinWasmExternRefTable)
SINGLETON_TYPE(RawUnsafeContinuation, BuiltinRawUnsafeContinuation)
SINGLETON_TYPE(NativeObject, BuiltinNativeObject)
SINGLETON_TYPE(BridgeObject, BuiltinBridgeObject)
Expand Down
44 changes: 44 additions & 0 deletions include/swift/AST/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,22 @@ class alignas(1 << TypeAlignInBits) TypeBase
return getRecursiveProperties().hasUnboundGeneric();
}

/// Determine whether this type contains a WebAssembly externref, either
/// directly as a builtin or via the standard library wrapper.
bool containsWasmExternref() const;

/// Determine whether this type contains an unsafe pointer whose pointee
/// contains a WebAssembly externref.
bool containsWasmExternrefPointer() const;

/// Determine whether this type contains a WebAssembly externref table,
/// either directly as a builtin or via the standard library wrapper.
bool containsWasmExternrefTable() const;

/// Determine whether this type contains an unsafe pointer whose pointee
/// contains a WebAssembly externref table.
bool containsWasmExternrefTablePointer() const;

/// Determine whether this type contains an error type.
bool hasError() const {
return getRecursiveProperties().hasError();
Expand Down Expand Up @@ -1944,6 +1960,34 @@ class BuiltinRawPointerType : public BuiltinType {
};
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinRawPointerType, BuiltinType)

/// BuiltinWasmExternRefType - The builtin WebAssembly externref type.
/// In LLVM IR, this is represented as a pointer in the reserved externref
/// address space.
class BuiltinWasmExternRefType : public BuiltinType {
friend class ASTContext;
BuiltinWasmExternRefType(const ASTContext &C)
: BuiltinType(TypeKind::BuiltinWasmExternRef, C) {}
public:
static bool classof(const TypeBase *T) {
return T->getKind() == TypeKind::BuiltinWasmExternRef;
}
};
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinWasmExternRefType, BuiltinType)

/// BuiltinWasmExternRefTableType - The builtin WebAssembly externref table
/// type. In LLVM IR, this is represented as a pointer in the reserved table
/// address space.
class BuiltinWasmExternRefTableType : public BuiltinType {
friend class ASTContext;
BuiltinWasmExternRefTableType(const ASTContext &C)
: BuiltinType(TypeKind::BuiltinWasmExternRefTable, C) {}
public:
static bool classof(const TypeBase *T) {
return T->getKind() == TypeKind::BuiltinWasmExternRefTable;
}
};
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinWasmExternRefTableType, BuiltinType)

/// BuiltinRawContinuationType - The builtin raw unsafe continuation type.
/// In C, this is a non-null AsyncTask*. This pointer is completely
/// unmanaged (the unresumed task is self-owning), but has more spare bits
Expand Down
3 changes: 3 additions & 0 deletions include/swift/Basic/Features.def
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ EXPERIMENTAL_FEATURE(Embedded, true)
/// Enables importing the Volatile module
EXPERIMENTAL_FEATURE(Volatile, true)

/// Enables WebAssembly externref interop support.
EXPERIMENTAL_FEATURE(WasmExternref, false)

// LEGACY: Enables ~Copyable and ~Escapable annotations on associatedtype declarations.
EXPERIMENTAL_FEATURE(SuppressedAssociatedTypes, true)

Expand Down
1 change: 1 addition & 0 deletions include/swift/ClangImporter/BuiltinMappedTypes.def
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ MAP_BUILTIN_TYPE(Half, CFloat16)
MAP_BUILTIN_TYPE(Float, CFloat)
MAP_BUILTIN_TYPE(Double, CDouble)
MAP_BUILTIN_TYPE(LongDouble, CLongDouble)
MAP_BUILTIN_TYPE(WasmExternRef, WasmExternref)

#undef MAP_BUILTIN_TYPE
#undef MAP_BUILTIN_INTEGER_TYPE
Expand Down
6 changes: 6 additions & 0 deletions include/swift/Strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ constexpr static BuiltinNameStringLiteral BUILTIN_TYPE_NAME_IMPLICITACTOR = {
/// The name of the Builtin type for RawPointer
constexpr static BuiltinNameStringLiteral BUILTIN_TYPE_NAME_RAWPOINTER = {
"Builtin.RawPointer"};
/// The name of the Builtin type for WasmExternRef
constexpr static BuiltinNameStringLiteral BUILTIN_TYPE_NAME_WASMEXTERNREF = {
"Builtin.WasmExternRef"};
/// The name of the Builtin type for WasmExternRefTable
constexpr static BuiltinNameStringLiteral BUILTIN_TYPE_NAME_WASMEXTERNREFTABLE = {
"Builtin.WasmExternRefTable"};
/// The name of the Builtin type for RawUnsafeContinuation
constexpr static BuiltinNameStringLiteral BUILTIN_TYPE_NAME_RAWUNSAFECONTINUATION = {
"Builtin.RawUnsafeContinuation"};
Expand Down
2 changes: 2 additions & 0 deletions lib/AST/ASTDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6260,6 +6260,8 @@ namespace {
TRIVIAL_TYPE_PRINTER(BuiltinNonDefaultDistributedActorStorage, builtin_non_default_distributed_actor_storage)
TRIVIAL_TYPE_PRINTER(BuiltinPackIndex, builtin_pack_index)
TRIVIAL_TYPE_PRINTER(BuiltinRawPointer, builtin_raw_pointer)
TRIVIAL_TYPE_PRINTER(BuiltinWasmExternRef, builtin_wasm_extern_ref)
TRIVIAL_TYPE_PRINTER(BuiltinWasmExternRefTable, builtin_wasm_extern_ref_table)
TRIVIAL_TYPE_PRINTER(BuiltinRawUnsafeContinuation, builtin_raw_unsafe_continuation)
TRIVIAL_TYPE_PRINTER(BuiltinNativeObject, builtin_native_object)
TRIVIAL_TYPE_PRINTER(BuiltinBridgeObject, builtin_bridge_object)
Expand Down
4 changes: 4 additions & 0 deletions lib/AST/ASTMangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,10 @@ void ASTMangler::appendType(Type type, GenericSignature sig,
return appendOperator("BP");
case TypeKind::BuiltinRawPointer:
return appendOperator("Bp");
case TypeKind::BuiltinWasmExternRef:
return appendOperator("Br");
case TypeKind::BuiltinWasmExternRefTable:
return appendOperator("BQ");
case TypeKind::BuiltinRawUnsafeContinuation:
return appendOperator("Bc");
case TypeKind::BuiltinNativeObject:
Expand Down
2 changes: 2 additions & 0 deletions lib/AST/ASTPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6718,6 +6718,8 @@ class TypePrinter : public TypeVisitor<TypePrinter, void, NonRecursivePrintOptio
Printer << buffer; \
}
ASTPRINTER_PRINT_BUILTINTYPE(BuiltinRawPointerType)
ASTPRINTER_PRINT_BUILTINTYPE(BuiltinWasmExternRefType)
ASTPRINTER_PRINT_BUILTINTYPE(BuiltinWasmExternRefTableType)
ASTPRINTER_PRINT_BUILTINTYPE(BuiltinRawUnsafeContinuationType)
ASTPRINTER_PRINT_BUILTINTYPE(BuiltinJobType)
ASTPRINTER_PRINT_BUILTINTYPE(BuiltinExecutorType)
Expand Down
97 changes: 97 additions & 0 deletions lib/AST/Builtins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ Type swift::getBuiltinType(ASTContext &Context, StringRef Name) {
.Case("Borrow", BuiltinTypeKind::BuiltinBorrow)
.StartsWith("Vec", BuiltinTypeKind::BuiltinVector)
.Case("RawPointer", BuiltinTypeKind::BuiltinRawPointer)
.Case("WasmExternRef", BuiltinTypeKind::BuiltinWasmExternRef)
.Case("WasmExternRefTable",
BuiltinTypeKind::BuiltinWasmExternRefTable)
.Case("RawUnsafeContinuation",
BuiltinTypeKind::BuiltinRawUnsafeContinuation)
.Case("Job", BuiltinTypeKind::BuiltinJob)
Expand Down Expand Up @@ -125,6 +128,10 @@ Type swift::getBuiltinType(ASTContext &Context, StringRef Name) {
}
case BuiltinTypeKind::BuiltinRawPointer:
return Context.TheRawPointerType;
case BuiltinTypeKind::BuiltinWasmExternRef:
return Context.TheWasmExternRefType;
case BuiltinTypeKind::BuiltinWasmExternRefTable:
return Context.TheWasmExternRefTableType;
case BuiltinTypeKind::BuiltinRawUnsafeContinuation:
return Context.TheRawUnsafeContinuationType;
case BuiltinTypeKind::BuiltinJob:
Expand Down Expand Up @@ -871,6 +878,66 @@ makeConcrete(Type type) {
return { type };
}

static ValueDecl *getWasmRefNullExtern(ASTContext &ctx, Identifier id) {
BuiltinFunctionBuilder builder(ctx);
builder.setResult(makeConcrete(ctx.TheWasmExternRefType));
return builder.build(id);
}

static ValueDecl *getWasmTableSizeExternRef(ASTContext &ctx, Identifier id) {
BuiltinFunctionBuilder builder(ctx);
builder.addParameter(makeConcrete(ctx.TheWasmExternRefTableType));
builder.setResult(makeConcrete(BuiltinIntegerType::get(32, ctx)));
return builder.build(id);
}

static ValueDecl *getWasmTableGetExternRef(ASTContext &ctx, Identifier id) {
BuiltinFunctionBuilder builder(ctx);
builder.addParameter(makeConcrete(ctx.TheWasmExternRefTableType));
builder.addParameter(makeConcrete(BuiltinIntegerType::get(32, ctx)));
builder.setResult(makeConcrete(ctx.TheWasmExternRefType));
return builder.build(id);
}

static ValueDecl *getWasmTableSetExternRef(ASTContext &ctx, Identifier id) {
BuiltinFunctionBuilder builder(ctx);
builder.addParameter(makeConcrete(ctx.TheWasmExternRefTableType));
builder.addParameter(makeConcrete(BuiltinIntegerType::get(32, ctx)));
builder.addParameter(makeConcrete(ctx.TheWasmExternRefType));
builder.setResult(makeConcrete(ctx.TheEmptyTupleType));
return builder.build(id);
}

static ValueDecl *getWasmTableGrowExternRef(ASTContext &ctx, Identifier id) {
BuiltinFunctionBuilder builder(ctx);
builder.addParameter(makeConcrete(ctx.TheWasmExternRefTableType));
builder.addParameter(makeConcrete(ctx.TheWasmExternRefType));
builder.addParameter(makeConcrete(BuiltinIntegerType::get(32, ctx)));
builder.setResult(makeConcrete(BuiltinIntegerType::get(32, ctx)));
return builder.build(id);
}

static ValueDecl *getWasmTableFillExternRef(ASTContext &ctx, Identifier id) {
BuiltinFunctionBuilder builder(ctx);
builder.addParameter(makeConcrete(ctx.TheWasmExternRefTableType));
builder.addParameter(makeConcrete(BuiltinIntegerType::get(32, ctx)));
builder.addParameter(makeConcrete(ctx.TheWasmExternRefType));
builder.addParameter(makeConcrete(BuiltinIntegerType::get(32, ctx)));
builder.setResult(makeConcrete(ctx.TheEmptyTupleType));
return builder.build(id);
}

static ValueDecl *getWasmTableCopyExternRef(ASTContext &ctx, Identifier id) {
BuiltinFunctionBuilder builder(ctx);
builder.addParameter(makeConcrete(ctx.TheWasmExternRefTableType));
builder.addParameter(makeConcrete(ctx.TheWasmExternRefTableType));
builder.addParameter(makeConcrete(BuiltinIntegerType::get(32, ctx)));
builder.addParameter(makeConcrete(BuiltinIntegerType::get(32, ctx)));
builder.addParameter(makeConcrete(BuiltinIntegerType::get(32, ctx)));
builder.setResult(makeConcrete(ctx.TheEmptyTupleType));
return builder.build(id);
}

static BuiltinFunctionBuilder::ParameterGenerator
makeGenericParam(unsigned index = 0) {
return { index };
Expand Down Expand Up @@ -3398,6 +3465,28 @@ ValueDecl *swift::getBuiltinValueDecl(ASTContext &Context, Identifier Id) {
case BuiltinValueKind::GlobalStringTablePointer:
return getGlobalStringTablePointer(Context, Id);

case BuiltinValueKind::WasmRefNullExtern:
if (!Types.empty()) return nullptr;
return getWasmRefNullExtern(Context, Id);
case BuiltinValueKind::WasmTableSizeExternRef:
if (!Types.empty()) return nullptr;
return getWasmTableSizeExternRef(Context, Id);
case BuiltinValueKind::WasmTableGetExternRef:
if (!Types.empty()) return nullptr;
return getWasmTableGetExternRef(Context, Id);
case BuiltinValueKind::WasmTableSetExternRef:
if (!Types.empty()) return nullptr;
return getWasmTableSetExternRef(Context, Id);
case BuiltinValueKind::WasmTableGrowExternRef:
if (!Types.empty()) return nullptr;
return getWasmTableGrowExternRef(Context, Id);
case BuiltinValueKind::WasmTableFillExternRef:
if (!Types.empty()) return nullptr;
return getWasmTableFillExternRef(Context, Id);
case BuiltinValueKind::WasmTableCopyExternRef:
if (!Types.empty()) return nullptr;
return getWasmTableCopyExternRef(Context, Id);

case BuiltinValueKind::ConvertStrongToUnownedUnsafe:
return getConvertStrongToUnownedUnsafe(Context, Id);

Expand Down Expand Up @@ -3638,6 +3727,8 @@ bool BuiltinType::isBitwiseCopyable() const {
case BuiltinTypeKind::BuiltinFloat:
case BuiltinTypeKind::BuiltinPackIndex:
case BuiltinTypeKind::BuiltinRawPointer:
case BuiltinTypeKind::BuiltinWasmExternRef:
case BuiltinTypeKind::BuiltinWasmExternRefTable:
case BuiltinTypeKind::BuiltinVector:
case BuiltinTypeKind::BuiltinExecutor:
case BuiltinTypeKind::BuiltinJob:
Expand Down Expand Up @@ -3678,6 +3769,12 @@ StringRef BuiltinType::getTypeName(SmallVectorImpl<char> &result,
case BuiltinTypeKind::BuiltinRawPointer:
printer << MAYBE_GET_NAMESPACED_BUILTIN(BUILTIN_TYPE_NAME_RAWPOINTER);
break;
case BuiltinTypeKind::BuiltinWasmExternRef:
printer << MAYBE_GET_NAMESPACED_BUILTIN(BUILTIN_TYPE_NAME_WASMEXTERNREF);
break;
case BuiltinTypeKind::BuiltinWasmExternRefTable:
printer << MAYBE_GET_NAMESPACED_BUILTIN(BUILTIN_TYPE_NAME_WASMEXTERNREFTABLE);
break;
case BuiltinTypeKind::BuiltinRawUnsafeContinuation:
printer << MAYBE_GET_NAMESPACED_BUILTIN(BUILTIN_TYPE_NAME_RAWUNSAFECONTINUATION);
break;
Expand Down
10 changes: 10 additions & 0 deletions lib/AST/ClangTypeConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,12 @@ ClangTypeConverter::visitBuiltinRawPointerType(BuiltinRawPointerType *type) {
return ClangASTContext.VoidPtrTy;
}

clang::QualType ClangTypeConverter::visitBuiltinWasmExternRefType(
BuiltinWasmExternRefType *) {
return getClangBuiltinTypeFromKind(ClangASTContext,
clang::BuiltinType::WasmExternRef);
}

clang::QualType
ClangTypeConverter::visitBuiltinIntegerType(BuiltinIntegerType *type) {
auto &clangCtx = ClangASTContext;
Expand Down Expand Up @@ -963,6 +969,10 @@ clang::QualType ClangTypeConverter::convertTemplateArgument(Type type) {
if (auto pointerType = type->getAs<BuiltinRawPointerType>())
return withCache([&]() { return visitBuiltinRawPointerType(pointerType); });

if (auto externRefType = type->getAs<BuiltinWasmExternRefType>())
return withCache(
[&]() { return visitBuiltinWasmExternRefType(externRefType); });

if (auto integerType = type->getAs<BuiltinIntegerType>())
return withCache([&]() { return visitBuiltinIntegerType(integerType); });

Expand Down
1 change: 1 addition & 0 deletions lib/AST/ClangTypeConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class ClangTypeConverter :
clang::QualType visitProtocolCompositionType(ProtocolCompositionType *type);
clang::QualType visitExistentialType(ExistentialType *type);
clang::QualType visitBuiltinRawPointerType(BuiltinRawPointerType *type);
clang::QualType visitBuiltinWasmExternRefType(BuiltinWasmExternRefType *type);
clang::QualType visitBuiltinIntegerType(BuiltinIntegerType *type);
clang::QualType visitBuiltinFloatType(BuiltinFloatType *type);
clang::QualType visitBuiltinVectorType(BuiltinVectorType *type);
Expand Down
Loading