mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
add some helper methods for IR passes to use.
Swift SVN r6407
This commit is contained in:
@@ -120,6 +120,13 @@ ArrayRef<Operand> SILInstruction::getAllOperands() const {
|
||||
return AllOperandsAccessor().visit(const_cast<SILInstruction*>(this));
|
||||
}
|
||||
|
||||
/// getOperandNumber - Return which operand this is in the operand list of the
|
||||
/// using instruction.
|
||||
unsigned Operand::getOperandNumber() const {
|
||||
return this - &cast<SILInstruction>(getUser())->getAllOperands()[0];
|
||||
}
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// SILInstruction Subclasses
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user