Skip to content

Commit 6b8c6a3

Browse files
committed
SIL: rename updateBorrowedFrom to updateBorrowArguments
NFC
1 parent 27bb00e commit 6b8c6a3

File tree

19 files changed

+39
-38
lines changed

19 files changed

+39
-38
lines changed

SwiftCompilerSources/Sources/Optimizer/PassManager/PassRegistration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ private func registerSwiftAnalyses() {
136136

137137
private func registerUtilities() {
138138
registerVerifier()
139-
registerBorrowedFromUpdater()
139+
registerBorrowArgumentsUpdater()
140140
}

SwiftCompilerSources/Sources/Optimizer/Utilities/BorrowedFromUpdater.swift renamed to SwiftCompilerSources/Sources/Optimizer/Utilities/BorrowArgumentsUpdater.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- BorrowedFromUpdater.swift ----------------------------------------===//
1+
//===--- BorrowArgumentsUpdater.swift -------------------------------------===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -98,8 +98,8 @@ private func addEnclosingValues(
9898
return true
9999
}
100100

101-
func registerBorrowedFromUpdater() {
102-
BridgedUtilities.registerBorrowedFromUpdater(
101+
func registerBorrowArgumentsUpdater() {
102+
BridgedUtilities.registerBorrowArgumentsUpdater(
103103
{ (bridgedCtxt: BridgedPassContext, bridgedFunction: BridgedFunction) in
104104
let context = FunctionPassContext(_bridged: bridgedCtxt)
105105
let function = bridgedFunction.function;

SwiftCompilerSources/Sources/Optimizer/Utilities/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
swift_compiler_sources(Optimizer
1010
AccessUtilsTest.swift
1111
AddressUtils.swift
12-
BorrowedFromUpdater.swift
12+
BorrowArgumentsUpdater.swift
1313
BorrowUtils.swift
1414
SpecializationCloner.swift
1515
DiagnosticEngine.swift

include/swift/SILOptimizer/OptimizerBridging.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ struct BridgedPostDomTree {
130130

131131
struct BridgedUtilities {
132132
typedef void (* _Nonnull VerifyFunctionFn)(BridgedPassContext, BridgedFunction);
133-
typedef void (* _Nonnull UpdateBorrowedFromFn)(BridgedPassContext, BridgedFunction);
134-
typedef void (* _Nonnull UpdateBorrowedFromPhisFn)(BridgedPassContext, BridgedArrayRef);
133+
typedef void (* _Nonnull UpdateFunctionFn)(BridgedPassContext, BridgedFunction);
134+
typedef void (* _Nonnull UpdatePhisFn)(BridgedPassContext, BridgedArrayRef);
135135

136136
static void registerVerifier(VerifyFunctionFn verifyFunctionFn);
137-
static void registerBorrowedFromUpdater(UpdateBorrowedFromFn updateBorrowedFromFn,
138-
UpdateBorrowedFromPhisFn updateBorrowedFromPhisFn);
137+
static void registerBorrowArgumentsUpdater(UpdateFunctionFn updateBorrowedFromFn,
138+
UpdatePhisFn updateBorrowedFromPhisFn);
139139
};
140140

141141
struct BridgedBasicBlockSet {

include/swift/SILOptimizer/Utils/OwnershipOptUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,9 @@ bool extendStoreBorrow(StoreBorrowInst *sbi,
357357
DeadEndBlocks *deadEndBlocks,
358358
InstModCallbacks callbacks = InstModCallbacks());
359359

360-
void updateBorrowedFrom(SILPassManager *pm, SILFunction *f);
360+
void updateAllBorrowArguments(SILPassManager *pm, SILFunction *f);
361361

362-
void updateBorrowedFromPhis(SILPassManager *pm, ArrayRef<SILPhiArgument *> phis);
362+
void updateBorrowArguments(SILPassManager *pm, ArrayRef<SILPhiArgument *> phis);
363363

364364
} // namespace swift
365365

lib/SILOptimizer/LoopTransforms/ArrayPropertyOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ class SwiftArrayPropertyOptPass : public SILFunctionTransform {
837837
if (getFunction()->getModule().getOptions().VerifyAll)
838838
getFunction()->verifyCriticalEdges();
839839

840-
updateBorrowedFrom(getPassManager(), Fn);
840+
updateAllBorrowArguments(getPassManager(), Fn);
841841

842842
// We preserve the dominator tree. Let's invalidate everything
843843
// else.

lib/SILOptimizer/LoopTransforms/LoopRotate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ class LoopRotation : public SILFunctionTransform {
514514
}
515515

516516
if (changed) {
517-
updateBorrowedFrom(PM, f);
517+
updateAllBorrowArguments(PM, f);
518518
// We preserve loop info and the dominator tree.
519519
domAnalysis->lockInvalidation();
520520
loopAnalysis->lockInvalidation();

lib/SILOptimizer/Mandatory/ClosureLifetimeFixup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ class ClosureLifetimeFixup : public SILFunctionTransform {
15291529
if (fixupClosureLifetimes(*getFunction(), dominanceAnalysis,
15301530
deadEndBlocksAnalysis, checkStackNesting,
15311531
modifiedCFG)) {
1532-
updateBorrowedFrom(getPassManager(), getFunction());
1532+
updateAllBorrowArguments(getPassManager(), getFunction());
15331533
if (checkStackNesting){
15341534
modifiedCFG |=
15351535
StackNesting::fixNesting(getFunction()) == StackNesting::Changes::CFG;

lib/SILOptimizer/SILCombiner/SILCombine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ class SILCombine : public SILFunctionTransform {
620620
bool Changed = Combiner.runOnFunction(*getFunction());
621621

622622
if (Changed) {
623-
updateBorrowedFrom(getPassManager(), getFunction());
623+
updateAllBorrowArguments(getPassManager(), getFunction());
624624
// Invalidate everything.
625625
invalidateAnalysis(SILAnalysis::InvalidationKind::FunctionBody);
626626
}

lib/SILOptimizer/SemanticARC/OwnedToGuaranteedPhiOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ bool swift::semanticarc::tryConvertOwnedPhisToGuaranteedPhis(Context &ctx) {
268268
}
269269

270270
if (madeChange)
271-
updateBorrowedFrom(ctx.pm, &ctx.fn);
271+
updateAllBorrowArguments(ctx.pm, &ctx.fn);
272272

273273
return madeChange;
274274
}

0 commit comments

Comments
 (0)