mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[gardening] Drop BB from all argument related code in SILBasicBlock.
Before this commit all code relating to handling arguments in SILBasicBlock had somewhere in the name BB. This is redundant given that the class's name is already SILBasicBlock. This commit drops those names. Some examples: getBBArg() => getArgument() BBArgList => ArgumentList bbarg_begin() => args_begin()
This commit is contained in:
@@ -601,7 +601,7 @@ namespace {
|
||||
static void updateBasicBlockArgTypes(SILBasicBlock *BB,
|
||||
TypeSubstitutionMap &TypeSubstMap) {
|
||||
// Check types of all BB arguments.
|
||||
for (auto &Arg : BB->getBBArgs()) {
|
||||
for (auto &Arg : BB->getArguments()) {
|
||||
if (!Arg->getType().getSwiftRValueType()->hasOpenedExistential())
|
||||
continue;
|
||||
// Type of this BB argument uses an opened existential.
|
||||
@@ -623,7 +623,7 @@ static void updateBasicBlockArgTypes(SILBasicBlock *BB,
|
||||
// Then replace all uses by an undef.
|
||||
Arg->replaceAllUsesWith(SILUndef::get(Arg->getType(), BB->getModule()));
|
||||
// Replace the type of the BB argument.
|
||||
BB->replaceBBArg(Arg->getIndex(), NewArgType, Arg->getDecl());
|
||||
BB->replaceArgument(Arg->getIndex(), NewArgType, Arg->getDecl());
|
||||
// Restore all uses to refer to the BB argument with updated type.
|
||||
for (auto ArgUse : OriginalArgUses) {
|
||||
ArgUse->set(Arg);
|
||||
@@ -667,7 +667,7 @@ bool CSE::processOpenExistentialRef(SILInstruction *Inst, ValueBase *V,
|
||||
// those uses by the new opened archetype.
|
||||
auto Successors = User->getParent()->getSuccessorBlocks();
|
||||
for (auto Successor : Successors) {
|
||||
if (Successor->bbarg_empty())
|
||||
if (Successor->args_empty())
|
||||
continue;
|
||||
// If a BB has any arguments, update their types if necessary.
|
||||
updateBasicBlockArgTypes(Successor, TypeSubstMap);
|
||||
|
||||
Reference in New Issue
Block a user