Swift optimizations: make isSwift51RuntimeAvailable sensitive to the resilience domain of the function.

This commit is contained in:
Erik Eckstein
2022-01-26 21:18:09 +01:00
parent 5cff292ad7
commit 603e837a8f
8 changed files with 33 additions and 17 deletions

View File

@@ -52,6 +52,13 @@ final public class Function : CustomStringConvertible, HasName {
public var argumentTypes: ArgumentTypeArray { ArgumentTypeArray(function: self) }
public var resultType: Type { SILFunction_getSILResultType(bridged).type }
/// True, if the function runs with a swift 5.1 runtime.
/// Note that this is function specific, because inlinable functions are de-serialized
/// in a client module, which might be compiled with a different deployment target.
public var isSwift51RuntimeAvailable: Bool {
SILFunction_isSwift51RuntimeAvailable(bridged) != 0
}
// Only to be called by PassContext
public func _modifyEffects(_ body: (inout FunctionEffects) -> ()) {
body(&effects)