mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Swift SIL: add var Function.instructions
To be used to iterate over all instructions in a function without the need of two loops - one for blocks and one for instructions.
This commit is contained in:
@@ -41,6 +41,11 @@ final public class Function : CustomStringConvertible, HasShortDescription {
|
||||
entryBlock.arguments.lazy.map { $0 as! FunctionArgument }
|
||||
}
|
||||
|
||||
/// All instructions of all blocks.
|
||||
public var instructions: LazySequence<FlattenSequence<LazyMapSequence<List<BasicBlock>, List<Instruction>>>> {
|
||||
blocks.lazy.flatMap { $0.instructions }
|
||||
}
|
||||
|
||||
public var numIndirectResultArguments: Int {
|
||||
SILFunction_numIndirectResultArguments(bridged)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user