• The convention of the function, indicated by theattribute. This is similar to the language-level @convention attribute, though SIL extends the set of supported conventions with additional distinctions not exposed at the language level:
  • ​@convention(thin)​​ indicates a "thin" function reference, which uses the Swift calling convention with no special "self" or "context" parameters.
  • ​@convention(thick)​​ indicates a "thick" function reference, which uses the Swift calling convention and carries a reference-counted context object used to represent captures or other state required by the function. This attribute is implied by ​​@callee_owned​​ or ​​@callee_guaranteed​​.
  • ​@convention(block)​​ indicates an Objective-C compatible block reference. The function value is represented as a reference to the block object, which is an ​​id​​-compatible Objective-C object that embeds its invocation function within the object. The invocation function uses the C calling convention.
  • ​@convention(c)​​ indicates a C function reference. The function value carries no context and uses the C calling convention.
  • ​@convention(objc_method)​​ indicates an Objective-C method implementation. The function uses the C calling convention, with the SIL-level ​​self​​ parameter (by SIL convention mapped to the final formal parameter) mapped to the ​​self​​ and ​​_cmd​​ arguments of the implementation.
  • ​@convention(method)​​ indicates a Swift instance method implementation. The function uses the Swift calling convention, using the special ​​self​​ parameter.
  • ​@convention(witness_method)​​ indicates a Swift protocol method implementation. The function's polymorphic convention is emitted in such a way as to guarantee that it is polymorphic across all possible implementors of the protocol.

 

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

 


------------------越是喧嚣的世界,越需要宁静的思考------------------ 合抱之木,生于毫末;九层之台,起于垒土;千里之行,始于足下。 积土成山,风雨兴焉;积水成渊,蛟龙生焉;积善成德,而神明自得,圣心备焉。故不积跬步,无以至千里;不积小流,无以成江海。骐骥一跃,不能十步;驽马十驾,功在不舍。锲而舍之,朽木不折;锲而不舍,金石可镂。蚓无爪牙之利,筋骨之强,上食埃土,下饮黄泉,用心一也。蟹六跪而二螯,非蛇鳝之穴无可寄托者,用心躁也。