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:
@@ -668,7 +668,7 @@ DevirtualizationResult swift::devirtualizeClassMethod(FullApplySite AI,
|
||||
ResultBB = TAI->getNormalBB();
|
||||
else {
|
||||
ResultBB = B.getFunction().createBasicBlock();
|
||||
ResultBB->createBBArg(ResultTy);
|
||||
ResultBB->createArgument(ResultTy);
|
||||
}
|
||||
|
||||
NormalBB = TAI->getNormalBB();
|
||||
@@ -678,7 +678,7 @@ DevirtualizationResult swift::devirtualizeClassMethod(FullApplySite AI,
|
||||
ErrorBB = TAI->getErrorBB();
|
||||
else {
|
||||
ErrorBB = B.getFunction().createBasicBlock();
|
||||
ErrorBB->createBBArg(TAI->getErrorBB()->getBBArg(0)->getType());
|
||||
ErrorBB->createArgument(TAI->getErrorBB()->getArgument(0)->getType());
|
||||
}
|
||||
|
||||
NewAI = B.createTryApply(AI.getLoc(), FRI, SubstCalleeSILType,
|
||||
@@ -687,26 +687,27 @@ DevirtualizationResult swift::devirtualizeClassMethod(FullApplySite AI,
|
||||
if (ErrorBB != TAI->getErrorBB()) {
|
||||
B.setInsertionPoint(ErrorBB);
|
||||
B.createBranch(TAI->getLoc(), TAI->getErrorBB(),
|
||||
{ErrorBB->getBBArg(0)});
|
||||
{ErrorBB->getArgument(0)});
|
||||
}
|
||||
|
||||
// Does the result value need to be casted?
|
||||
ResultCastRequired = ResultTy != NormalBB->getBBArg(0)->getType();
|
||||
ResultCastRequired = ResultTy != NormalBB->getArgument(0)->getType();
|
||||
|
||||
if (ResultBB != NormalBB)
|
||||
B.setInsertionPoint(ResultBB);
|
||||
else if (ResultCastRequired) {
|
||||
B.setInsertionPoint(NormalBB->begin());
|
||||
// Collect all uses, before casting.
|
||||
for (auto *Use : NormalBB->getBBArg(0)->getUses()) {
|
||||
for (auto *Use : NormalBB->getArgument(0)->getUses()) {
|
||||
OriginalResultUses.push_back(Use);
|
||||
}
|
||||
NormalBB->getBBArg(0)->replaceAllUsesWith(SILUndef::get(AI.getType(), Mod));
|
||||
NormalBB->replaceBBArg(0, ResultTy, nullptr);
|
||||
NormalBB->getArgument(0)->replaceAllUsesWith(
|
||||
SILUndef::get(AI.getType(), Mod));
|
||||
NormalBB->replaceArgument(0, ResultTy, nullptr);
|
||||
}
|
||||
|
||||
// The result value is passed as a parameter to the normal block.
|
||||
ResultValue = ResultBB->getBBArg(0);
|
||||
ResultValue = ResultBB->getArgument(0);
|
||||
}
|
||||
|
||||
// Check if any casting is required for the return value.
|
||||
|
||||
Reference in New Issue
Block a user