Skip to content

Commit e49ef77

Browse files
committed
[region-isolation] Rename RequireInOutSendingAtFunctionExit -> InOutSendingAtFunctionExit.
I am going to be doing more types of checks for such inout sending types, so it makes sense to rename it to have a more general name.
1 parent df24fc4 commit e49ef77

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

include/swift/SILOptimizer/Utils/PartitionUtils.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ enum class PartitionOpKind : uint8_t {
460460
/// parameter is reinitialized with a disconnected value.
461461
///
462462
/// Takes one parameter, the inout parameter that we need to check.
463-
RequireInOutSendingAtFunctionExit,
463+
InOutSendingAtFunctionExit,
464464
};
465465

466466
/// PartitionOp represents a primitive operation that can be performed on
@@ -568,9 +568,9 @@ class PartitionOp {
568568
return PartitionOp(PartitionOpKind::UnknownPatternError, elt, sourceInst);
569569
}
570570

571-
static PartitionOp
572-
RequireInOutSendingAtFunctionExit(Element elt, SILInstruction *sourceInst) {
573-
return PartitionOp(PartitionOpKind::RequireInOutSendingAtFunctionExit, elt,
571+
static PartitionOp InOutSendingAtFunctionExit(Element elt,
572+
SILInstruction *sourceInst) {
573+
return PartitionOp(PartitionOpKind::InOutSendingAtFunctionExit, elt,
574574
sourceInst);
575575
}
576576

@@ -1399,7 +1399,7 @@ struct PartitionOpEvaluator {
13991399
}
14001400
}
14011401
return;
1402-
case PartitionOpKind::RequireInOutSendingAtFunctionExit: {
1402+
case PartitionOpKind::InOutSendingAtFunctionExit: {
14031403
assert(op.getOpArgs().size() == 1 &&
14041404
"Require PartitionOp should be passed 1 argument");
14051405
assert(p.isTrackingElement(op.getOpArgs()[0]) &&

lib/SILOptimizer/Analysis/RegionAnalysis.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,12 +1240,12 @@ struct PartitionOpBuilder {
12401240
PartitionOp::Require(lookupValueID(value), currentInst));
12411241
}
12421242

1243-
void addRequireInOutSendingAtFunctionExit(SILValue value) {
1243+
void addInOutSendingAtFunctionExit(SILValue value) {
12441244
assert(valueHasID(value, /*dumpIfHasNoID=*/true) &&
12451245
"required value should already have been encountered");
12461246
currentInstPartitionOps.emplace_back(
1247-
PartitionOp::RequireInOutSendingAtFunctionExit(lookupValueID(value),
1248-
currentInst));
1247+
PartitionOp::InOutSendingAtFunctionExit(lookupValueID(value),
1248+
currentInst));
12491249
}
12501250

12511251
void addUnknownPatternError(SILValue value) {
@@ -2402,15 +2402,15 @@ class PartitionOpTranslator {
24022402

24032403
/// Adds requires for all sending inout parameters to make sure that they are
24042404
/// properly updated before the end of the function.
2405-
void addRequiresForInOutParameters(TermInst *inst) {
2405+
void addEndOfFunctionChecksForInOutSendingParameters(TermInst *inst) {
24062406
assert(inst->isFunctionExiting() && "Must be function exiting term inst?!");
24072407
for (auto *arg : inst->getFunction()->getArguments()) {
24082408
auto *fArg = cast<SILFunctionArgument>(arg);
24092409
if (fArg->getArgumentConvention().isInoutConvention() &&
24102410
fArg->getKnownParameterInfo().hasOption(SILParameterInfo::Sending)) {
24112411
if (auto ns = tryToTrackValue(arg)) {
24122412
auto rep = ns->getRepresentative().getValue();
2413-
builder.addRequireInOutSendingAtFunctionExit(rep);
2413+
builder.addInOutSendingAtFunctionExit(rep);
24142414
}
24152415
}
24162416
}
@@ -2838,7 +2838,7 @@ CONSTANT_TRANSLATION(DynamicMethodBranchInst, TerminatorPhi)
28382838
#define FUNCTION_EXITING_TERMINATOR_CONSTANT(INST, Kind) \
28392839
TranslationSemantics PartitionOpTranslator::visit##INST(INST *inst) { \
28402840
assert(inst->isFunctionExiting() && "Must be function exiting?!"); \
2841-
addRequiresForInOutParameters(inst); \
2841+
addEndOfFunctionChecksForInOutSendingParameters(inst); \
28422842
return TranslationSemantics::Kind; \
28432843
}
28442844

@@ -3090,7 +3090,7 @@ PartitionOpTranslator::visitLoadBorrowInst(LoadBorrowInst *lbi) {
30903090
}
30913091

30923092
TranslationSemantics PartitionOpTranslator::visitReturnInst(ReturnInst *ri) {
3093-
addRequiresForInOutParameters(ri);
3093+
addEndOfFunctionChecksForInOutSendingParameters(ri);
30943094
if (ri->getFunction()->getLoweredFunctionType()->hasSendingResult()) {
30953095
return TranslationSemantics::TransferringNoResult;
30963096
}

lib/SILOptimizer/Utils/PartitionUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ void PartitionOp::print(llvm::raw_ostream &os, bool extraSpace) const {
7878
os << "unknown pattern error ";
7979
os << "%%" << opArgs[0];
8080
break;
81-
case PartitionOpKind::RequireInOutSendingAtFunctionExit:
81+
case PartitionOpKind::InOutSendingAtFunctionExit:
8282
constexpr static char extraSpaceLiteral[10] = " ";
83-
os << "require_inout_sending_at_function_exit ";
83+
os << "inout_sending_at_function_exit ";
8484
if (extraSpace)
8585
os << extraSpaceLiteral;
8686
os << "%%" << opArgs[0];

0 commit comments

Comments
 (0)