mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Introduce the LogicValue protocol, which is used to establish when a particular type can be used as a logical value in a condition. Make Bool conform to this protocol. Rename the Builtin.i1-returning Bool.getLogicValue() to _getBuiltinLogicValue(), because this is meant to be a builtin hook for the compiler. We can add more underscores here if needed to hide this further from users. Move the implementation of _getBool() into C code. It was performing an 'if' on a Builtin.i1, which does not (and should not!) conform to the LogicValue protocol. Once more oneof IR generation comes online, we'll be able to write both this and _getBuiltinLogicValue in Swift directly. Swift SVN r5140
558 B
558 B