mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SIL] add BasicBlock.singleSuccessor
This commit is contained in:
@@ -53,6 +53,10 @@ final public class BasicBlock : CustomStringConvertible, HasShortDescription, Eq
|
||||
|
||||
public var hasSinglePredecessor: Bool { singlePredecessor != nil }
|
||||
|
||||
public var singleSuccessor: BasicBlock? {
|
||||
successors.count == 1 ? successors[0] : nil
|
||||
}
|
||||
|
||||
/// The index of the basic block in its function.
|
||||
/// This has O(n) complexity. Only use it for debugging
|
||||
public var index: Int {
|
||||
|
||||
Reference in New Issue
Block a user