Skip to content

Commit c6f7f97

Browse files
authored
Merge pull request llvm#23981 from gottesmm/pr-d8251fee09379fbd0cee5696f7b97a85ca886cb2
2 parents bb8351b + f7b014b commit c6f7f97

File tree

4 files changed

+98
-98
lines changed

4 files changed

+98
-98
lines changed

include/swift/SILOptimizer/Utils/CastOptimizer.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,34 @@ struct SILDynamicCastInst;
3434

3535
/// This is a helper class used to optimize casts.
3636
class CastOptimizer {
37-
SILOptFunctionBuilder &FunctionBuilder;
37+
SILOptFunctionBuilder &functionBuilder;
3838

3939
/// Temporary context for clients that do not provide their own.
40-
SILBuilderContext TempBuilderContext;
40+
SILBuilderContext tempBuilderContext;
4141

4242
/// Reference to the provided SILBuilderContext.
43-
SILBuilderContext &BuilderContext;
43+
SILBuilderContext &builderContext;
4444

4545
/// Callback that replaces the first SILValue's uses with a use of the second
4646
/// value.
47-
std::function<void(SILValue, SILValue)> ReplaceValueUsesAction;
47+
std::function<void(SILValue, SILValue)> replaceValueUsesAction;
4848

4949
/// Callback that replaces a SingleValueInstruction with a ValueBase after
5050
/// updating any status in the caller.
5151
std::function<void(SingleValueInstruction *, ValueBase *)>
52-
ReplaceInstUsesAction;
52+
replaceInstUsesAction;
5353

5454
/// Callback that erases an instruction and performs any state updates in the
5555
/// caller required.
56-
std::function<void(SILInstruction *)> EraseInstAction;
56+
std::function<void(SILInstruction *)> eraseInstAction;
5757

5858
/// Callback to call after an optimization was performed based on the fact
5959
/// that a cast will succeed.
60-
std::function<void()> WillSucceedAction;
60+
std::function<void()> willSucceedAction;
6161

6262
/// Callback to call after an optimization was performed based on the fact
6363
/// that a cast will fail.
64-
std::function<void()> WillFailAction;
64+
std::function<void()> willFailAction;
6565

6666
public:
6767
CastOptimizer(SILOptFunctionBuilder &FunctionBuilder,
@@ -72,13 +72,13 @@ class CastOptimizer {
7272
std::function<void(SILInstruction *)> EraseAction,
7373
std::function<void()> WillSucceedAction,
7474
std::function<void()> WillFailAction = []() {})
75-
: FunctionBuilder(FunctionBuilder),
76-
TempBuilderContext(FunctionBuilder.getModule()),
77-
BuilderContext(BuilderContext ? *BuilderContext : TempBuilderContext),
78-
ReplaceValueUsesAction(ReplaceValueUsesAction),
79-
ReplaceInstUsesAction(ReplaceInstUsesAction),
80-
EraseInstAction(EraseAction), WillSucceedAction(WillSucceedAction),
81-
WillFailAction(WillFailAction) {}
75+
: functionBuilder(FunctionBuilder),
76+
tempBuilderContext(FunctionBuilder.getModule()),
77+
builderContext(BuilderContext ? *BuilderContext : tempBuilderContext),
78+
replaceValueUsesAction(ReplaceValueUsesAction),
79+
replaceInstUsesAction(ReplaceInstUsesAction),
80+
eraseInstAction(EraseAction), willSucceedAction(WillSucceedAction),
81+
willFailAction(WillFailAction) {}
8282

8383
// This constructor is used in
8484
// 'SILOptimizer/Mandatory/ConstantPropagation.cpp'. MSVC2015 compiler

lib/SILOptimizer/Transforms/SimplifyCFG.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,23 +2149,23 @@ bool SimplifyCFG::simplifyCheckedCastBranchBlock(CheckedCastBranchInst *CCBI) {
21492149
bool MadeChange = false;
21502150
CastOptimizer CastOpt(
21512151
FuncBuilder, nullptr /*SILBuilderContext*/,
2152-
/* ReplaceValueUsesAction */
2152+
/* replaceValueUsesAction */
21532153
[&MadeChange](SILValue oldValue, SILValue newValue) {
21542154
MadeChange = true;
21552155
},
2156-
/* ReplaceInstUsesAction */
2156+
/* replaceInstUsesAction */
21572157
[&MadeChange](SILInstruction *I, ValueBase *V) { MadeChange = true; },
2158-
/* EraseInstAction */
2158+
/* eraseInstAction */
21592159
[&MadeChange](SILInstruction *I) {
21602160
MadeChange = true;
21612161
I->eraseFromParent();
21622162
},
2163-
/* WillSucceedAction */
2163+
/* willSucceedAction */
21642164
[&]() {
21652165
MadeChange |= removeIfDead(FailureBB);
21662166
addToWorklist(ThisBB);
21672167
},
2168-
/* WillFailAction */
2168+
/* willFailAction */
21692169
[&]() {
21702170
MadeChange |= removeIfDead(SuccessBB);
21712171
addToWorklist(ThisBB);
@@ -2184,23 +2184,23 @@ bool SimplifyCFG::simplifyCheckedCastValueBranchBlock(
21842184
bool MadeChange = false;
21852185
CastOptimizer CastOpt(
21862186
FuncBuilder, nullptr /*SILBuilderContext*/,
2187-
/* ReplaceValueUsesAction */
2187+
/* replaceValueUsesAction */
21882188
[&MadeChange](SILValue oldValue, SILValue newValue) {
21892189
MadeChange = true;
21902190
},
2191-
/* ReplaceInstUsesAction */
2191+
/* replaceInstUsesAction */
21922192
[&MadeChange](SILInstruction *I, ValueBase *V) { MadeChange = true; },
2193-
/* EraseInstAction */
2193+
/* eraseInstAction */
21942194
[&MadeChange](SILInstruction *I) {
21952195
MadeChange = true;
21962196
I->eraseFromParent();
21972197
},
2198-
/* WillSucceedAction */
2198+
/* willSucceedAction */
21992199
[&]() {
22002200
MadeChange |= removeIfDead(FailureBB);
22012201
addToWorklist(ThisBB);
22022202
},
2203-
/* WillFailAction */
2203+
/* willFailAction */
22042204
[&]() {
22052205
MadeChange |= removeIfDead(SuccessBB);
22062206
addToWorklist(ThisBB);
@@ -2220,21 +2220,21 @@ simplifyCheckedCastAddrBranchBlock(CheckedCastAddrBranchInst *CCABI) {
22202220
bool MadeChange = false;
22212221
CastOptimizer CastOpt(
22222222
FuncBuilder, nullptr /*SILBuilderContext*/,
2223-
/* ReplaceValueUsesAction */
2223+
/* replaceValueUsesAction */
22242224
[&MadeChange](SILValue, SILValue) { MadeChange = true; },
2225-
/* ReplaceInstUsesAction */
2225+
/* replaceInstUsesAction */
22262226
[&MadeChange](SILInstruction *I, ValueBase *V) { MadeChange = true; },
2227-
/* EraseInstAction */
2227+
/* eraseInstAction */
22282228
[&MadeChange](SILInstruction *I) {
22292229
MadeChange = true;
22302230
I->eraseFromParent();
22312231
},
2232-
/* WillSucceedAction */
2232+
/* willSucceedAction */
22332233
[&]() {
22342234
MadeChange |= removeIfDead(FailureBB);
22352235
addToWorklist(ThisBB);
22362236
},
2237-
/* WillFailAction */
2237+
/* willFailAction */
22382238
[&]() {
22392239
MadeChange |= removeIfDead(SuccessBB);
22402240
addToWorklist(ThisBB);

0 commit comments

Comments
 (0)