swift的类型描述符

Metatype Types

A concrete or existential metatype in SIL must describe its representation. This can be:

  • @thin, meaning that it requires no storage and thus necessarily represents an exact type (only allowed for concrete metatypes);
  • @thick, meaning that it stores a reference to a type or (if a concrete class) a subclass of that type; or
  • @objc, meaning that it stores a reference to a class type (or a subclass thereof) using an Objective-C class object representation rather than the native Swift type-object representation.

用于类型和函数类型的描述

https://github.com/apple/swift/blob/master/docs/SIL.rst#metatype-types

%2 = function_ref @ProtocolCase.NormalStruct.init() -> ProtocolCase.NormalStruct : $@convention(method) (@thin NormalStruct.Type) -> NormalStruct // user: %3

猜你喜欢

转载自www.cnblogs.com/feng9exe/p/10601810.html