mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Remove SILBasicBlock::getBBArgIndex(SILArgument *) in favor of SILArgument::getIndex().
The index is a property of the argument. There is no reason from a modeling perspective to go through the BB to get it. Swift SVN r21338
This commit is contained in:
@@ -89,15 +89,6 @@ SILArgument *SILBasicBlock::replaceBBArg(unsigned i, SILType Ty, ValueDecl *D) {
|
||||
return NewArg;
|
||||
}
|
||||
|
||||
size_t SILBasicBlock::getBBArgIndex(SILArgument *Target) {
|
||||
auto *Block = Target->getParent();
|
||||
for (size_t i = 0, e = Block->getNumBBArg(); i != e; ++i)
|
||||
if (Block->getBBArg(i) == Target)
|
||||
return i;
|
||||
|
||||
llvm_unreachable("Expected to find argument in block's argument list!");
|
||||
}
|
||||
|
||||
SILArgument *SILBasicBlock::createArgument(SILType Ty) {
|
||||
return new (getModule()) SILArgument(Ty, this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user