Skip to content

Commit 8ab8e75

Browse files
authored
Merge pull request #19557 from gottesmm/pr-39539664cf3e8eeadf30363e1f27d58cca0974fb
[gardening] Rename references to SILPHIArgument => SILPhiArgument.
2 parents 2aac886 + d57a88a commit 8ab8e75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+225
-225
lines changed

include/swift/SIL/MemAccessUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ObjectProjection {
8080
/// while global variables and class properties are not. Unidentified storage is
8181
/// associated with a SILValue that produces the accessed address but has not
8282
/// been determined to be the base of a storage object. It may, for example,
83-
/// be a SILPHIArgument.
83+
/// be a SILPhiArgument.
8484
///
8585
/// An invalid AccessedStorage object is marked Unidentified and contains an
8686
/// invalid value. This signals that analysis has failed to recognize an
@@ -380,7 +380,7 @@ namespace swift {
380380
/// The returned AccessedStorage represents the best attempt to find the base of
381381
/// the storage object being accessed at `sourceAddr`. This may be a fully
382382
/// identified storage base of known kind, or a valid but Unidentified storage
383-
/// object, such as a SILPHIArgument.
383+
/// object, such as a SILPhiArgument.
384384
///
385385
/// This may return an invalid storage object if the address producer is not
386386
/// recognized by a whitelist of recognizable access patterns. The result must

include/swift/SIL/SILArgument.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class SILArgument : public ValueBase {
146146
friend SILBasicBlock;
147147
};
148148

149-
class SILPHIArgument : public SILArgument {
149+
class SILPhiArgument : public SILArgument {
150150
public:
151151
/// Return true if this is block argument is actually a phi argument as
152152
/// opposed to a cast or projection.
@@ -155,22 +155,22 @@ class SILPHIArgument : public SILArgument {
155155
/// If this argument is a phi, return the incoming phi value for the given
156156
/// predecessor BB. If this argument is not a phi, return an invalid SILValue.
157157
///
158-
/// FIXME: Once SILPHIArgument actually implies that it is a phi argument,
158+
/// FIXME: Once SILPhiArgument actually implies that it is a phi argument,
159159
/// this will be guaranteed to return a valid SILValue.
160160
SILValue getIncomingPhiValue(SILBasicBlock *BB);
161161

162162
/// If this argument is a phi, populate `OutArray` with the incoming phi
163163
/// values for each predecessor BB. If this argument is not a phi, return
164164
/// false.
165165
///
166-
/// FIXME: Once SILPHIArgument actually implies that it is a phi argument,
166+
/// FIXME: Once SILPhiArgument actually implies that it is a phi argument,
167167
/// this will always succeed.
168168
bool getIncomingPhiValues(llvm::SmallVectorImpl<SILValue> &OutArray);
169169

170170
/// If this argument is a phi, populate `OutArray` with each predecessor block
171171
/// and its incoming phi value. If this argument is not a phi, return false.
172172
///
173-
/// FIXME: Once SILPHIArgument actually implies that it is a phi argument,
173+
/// FIXME: Once SILPhiArgument actually implies that it is a phi argument,
174174
/// this will always succeed.
175175
bool getIncomingPhiValues(
176176
llvm::SmallVectorImpl<std::pair<SILBasicBlock *, SILValue>> &OutArray);
@@ -205,24 +205,24 @@ class SILPHIArgument : public SILArgument {
205205
static bool classof(const SILInstruction *) = delete;
206206
static bool classof(const SILUndef *) = delete;
207207
static bool classof(const SILNode *node) {
208-
return node->getKind() == SILNodeKind::SILPHIArgument;
208+
return node->getKind() == SILNodeKind::SILPhiArgument;
209209
}
210210

211211
private:
212212
friend SILBasicBlock;
213-
SILPHIArgument(SILBasicBlock *ParentBB, SILType Ty, ValueOwnershipKind OwnershipKind,
213+
SILPhiArgument(SILBasicBlock *ParentBB, SILType Ty, ValueOwnershipKind OwnershipKind,
214214
const ValueDecl *D = nullptr)
215-
: SILArgument(ValueKind::SILPHIArgument, ParentBB, Ty, OwnershipKind, D) {}
216-
SILPHIArgument(SILBasicBlock *ParentBB, SILBasicBlock::arg_iterator Pos,
215+
: SILArgument(ValueKind::SILPhiArgument, ParentBB, Ty, OwnershipKind, D) {}
216+
SILPhiArgument(SILBasicBlock *ParentBB, SILBasicBlock::arg_iterator Pos,
217217
SILType Ty, ValueOwnershipKind OwnershipKind,
218218
const ValueDecl *D = nullptr)
219-
: SILArgument(ValueKind::SILPHIArgument, ParentBB, Pos, Ty, OwnershipKind, D) {}
219+
: SILArgument(ValueKind::SILPhiArgument, ParentBB, Pos, Ty, OwnershipKind, D) {}
220220

221221
// A special constructor, only intended for use in
222222
// SILBasicBlock::replacePHIArg.
223-
explicit SILPHIArgument(SILType Ty, ValueOwnershipKind OwnershipKind,
223+
explicit SILPhiArgument(SILType Ty, ValueOwnershipKind OwnershipKind,
224224
const ValueDecl *D = nullptr)
225-
: SILArgument(ValueKind::SILPHIArgument, Ty, OwnershipKind, D) {}
225+
: SILArgument(ValueKind::SILPhiArgument, Ty, OwnershipKind, D) {}
226226
};
227227

228228
class SILFunctionArgument : public SILArgument {
@@ -283,7 +283,7 @@ class SILFunctionArgument : public SILArgument {
283283
//===----------------------------------------------------------------------===//
284284

285285
inline bool SILArgument::isPhiArgument() {
286-
if (auto *phiArg = dyn_cast<SILPHIArgument>(this))
286+
if (auto *phiArg = dyn_cast<SILPhiArgument>(this))
287287
return phiArg->isPhiArgument();
288288

289289
return false;
@@ -292,35 +292,35 @@ inline bool SILArgument::isPhiArgument() {
292292
inline SILValue SILArgument::getIncomingPhiValue(SILBasicBlock *BB) {
293293
if (isa<SILFunctionArgument>(this))
294294
return SILValue();
295-
return cast<SILPHIArgument>(this)->getIncomingPhiValue(BB);
295+
return cast<SILPhiArgument>(this)->getIncomingPhiValue(BB);
296296
}
297297

298298
inline bool
299299
SILArgument::getIncomingPhiValues(llvm::SmallVectorImpl<SILValue> &OutArray) {
300300
if (isa<SILFunctionArgument>(this))
301301
return false;
302-
return cast<SILPHIArgument>(this)->getIncomingPhiValues(OutArray);
302+
return cast<SILPhiArgument>(this)->getIncomingPhiValues(OutArray);
303303
}
304304

305305
inline bool SILArgument::getIncomingPhiValues(
306306
llvm::SmallVectorImpl<std::pair<SILBasicBlock *, SILValue>> &OutArray) {
307307
if (isa<SILFunctionArgument>(this))
308308
return false;
309-
return cast<SILPHIArgument>(this)->getIncomingPhiValues(OutArray);
309+
return cast<SILPhiArgument>(this)->getIncomingPhiValues(OutArray);
310310
}
311311

312312
inline bool SILArgument::getSingleTerminatorOperands(
313313
llvm::SmallVectorImpl<SILValue> &OutArray) {
314314
if (isa<SILFunctionArgument>(this))
315315
return false;
316-
return cast<SILPHIArgument>(this)->getSingleTerminatorOperands(OutArray);
316+
return cast<SILPhiArgument>(this)->getSingleTerminatorOperands(OutArray);
317317
}
318318

319319
inline bool SILArgument::getSingleTerminatorOperands(
320320
llvm::SmallVectorImpl<std::pair<SILBasicBlock *, SILValue>> &OutArray) {
321321
if (isa<SILFunctionArgument>(this))
322322
return false;
323-
return cast<SILPHIArgument>(this)->getSingleTerminatorOperands(OutArray);
323+
return cast<SILPhiArgument>(this)->getSingleTerminatorOperands(OutArray);
324324
}
325325

326326
} // end swift namespace

include/swift/SIL/SILArgumentArrayRef.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
namespace swift {
2828

2929
class SILArgument;
30-
class SILPHIArgument;
30+
class SILPhiArgument;
3131
class SILFunctionArgument;
3232

33-
using PHIArgumentArrayRef =
34-
TransformArrayRef<function_ref<SILPHIArgument *(SILArgument *)>>;
33+
using PhiArgumentArrayRef =
34+
TransformArrayRef<function_ref<SILPhiArgument *(SILArgument *)>>;
3535

3636
using FunctionArgumentArrayRef =
3737
TransformArrayRef<function_ref<SILFunctionArgument *(SILArgument *)>>;

include/swift/SIL/SILBasicBlock.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace swift {
2727

2828
class SILFunction;
2929
class SILArgument;
30-
class SILPHIArgument;
30+
class SILPhiArgument;
3131
class SILFunctionArgument;
3232
class SILPrintContext;
3333

@@ -165,7 +165,7 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
165165
/// Iterator over the PHI arguments of a basic block.
166166
/// Defines an implicit cast operator on the iterator, so that this iterator
167167
/// can be used in the SSAUpdaterImpl.
168-
template <typename PHIArgT = SILPHIArgument,
168+
template <typename PHIArgT = SILPhiArgument,
169169
typename IteratorT = arg_iterator>
170170
class phi_iterator_impl {
171171
private:
@@ -180,7 +180,7 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
180180
bool operator!=(const phi_iterator_impl& x) const { return !operator==(x); }
181181
};
182182
typedef phi_iterator_impl<> phi_iterator;
183-
typedef phi_iterator_impl<const SILPHIArgument,
183+
typedef phi_iterator_impl<const SILPhiArgument,
184184
SILBasicBlock::const_arg_iterator>
185185
const_phi_iterator;
186186

@@ -194,9 +194,9 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
194194

195195
ArrayRef<SILArgument *> getArguments() const { return ArgumentList; }
196196

197-
/// Returns a transform array ref that performs llvm::cast<SILPHIArgument> on
197+
/// Returns a transform array ref that performs llvm::cast<SILPhiArgument> on
198198
/// each argument and then returns the downcasted value.
199-
PHIArgumentArrayRef getPHIArguments() const;
199+
PhiArgumentArrayRef getPhiArguments() const;
200200

201201
/// Returns a transform array ref that performs
202202
/// llvm::cast<SILFunctionArgument> on each argument and then returns the
@@ -234,27 +234,27 @@ public llvm::ilist_node<SILBasicBlock>, public SILAllocated<SILBasicBlock> {
234234
/// Replace the \p{i}th BB arg with a new BBArg with SILType \p Ty and
235235
/// ValueDecl
236236
/// \p D.
237-
SILPHIArgument *replacePHIArgument(unsigned i, SILType Ty,
237+
SILPhiArgument *replacePhiArgument(unsigned i, SILType Ty,
238238
ValueOwnershipKind Kind,
239239
const ValueDecl *D = nullptr);
240240

241241
/// Allocate a new argument of type \p Ty and append it to the argument
242242
/// list. Optionally you can pass in a value decl parameter.
243-
SILPHIArgument *createPHIArgument(SILType Ty, ValueOwnershipKind Kind,
243+
SILPhiArgument *createPhiArgument(SILType Ty, ValueOwnershipKind Kind,
244244
const ValueDecl *D = nullptr);
245245

246-
/// Insert a new SILPHIArgument with type \p Ty and \p Decl at position \p
246+
/// Insert a new SILPhiArgument with type \p Ty and \p Decl at position \p
247247
/// Pos.
248-
SILPHIArgument *insertPHIArgument(arg_iterator Pos, SILType Ty,
248+
SILPhiArgument *insertPhiArgument(arg_iterator Pos, SILType Ty,
249249
ValueOwnershipKind Kind,
250250
const ValueDecl *D = nullptr);
251251

252-
SILPHIArgument *insertPHIArgument(unsigned Index, SILType Ty,
252+
SILPhiArgument *insertPhiArgument(unsigned Index, SILType Ty,
253253
ValueOwnershipKind Kind,
254254
const ValueDecl *D = nullptr) {
255255
arg_iterator Pos = ArgumentList.begin();
256256
std::advance(Pos, Index);
257-
return insertPHIArgument(Pos, Ty, Kind, D);
257+
return insertPhiArgument(Pos, Ty, Kind, D);
258258
}
259259

260260
/// \brief Remove all block arguments.

include/swift/SIL/SILCloner.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ SILCloner<ImplClass>::visitSILBasicBlock(SILBasicBlock* BB) {
414414
auto *MappedBB = F.createBasicBlock();
415415
BBMap.insert(std::make_pair(Succ.getBB(), MappedBB));
416416
// Create new arguments for each of the original block's arguments.
417-
for (auto *Arg : Succ.getBB()->getPHIArguments()) {
418-
SILValue MappedArg = MappedBB->createPHIArgument(
417+
for (auto *Arg : Succ.getBB()->getPhiArguments()) {
418+
SILValue MappedArg = MappedBB->createPhiArgument(
419419
getOpType(Arg->getType()), Arg->getOwnershipKind());
420420

421421
ValueMap.insert(std::make_pair(Arg, MappedArg));

include/swift/SIL/SILInstruction.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class SILInstructionResultArray;
6363
class SILOpenedArchetypesState;
6464
class SILType;
6565
class SILArgument;
66-
class SILPHIArgument;
66+
class SILPhiArgument;
6767
class SILUndef;
6868
class Stmt;
6969
class StringLiteralExpr;
@@ -6608,7 +6608,7 @@ class TermInst : public NonValueInstruction {
66086608

66096609
using SuccessorBlockArgumentsListTy =
66106610
TransformRange<ConstSuccessorListTy,
6611-
function_ref<PHIArgumentArrayRef(const SILSuccessor &)>>;
6611+
function_ref<PhiArgumentArrayRef(const SILSuccessor &)>>;
66126612

66136613
/// Return the range of Argument arrays for each successor of this
66146614
/// block.
@@ -6827,10 +6827,10 @@ class BranchInst final
68276827
unsigned getNumArgs() const { return getAllOperands().size(); }
68286828
SILValue getArg(unsigned i) const { return getAllOperands()[i].get(); }
68296829

6830-
/// Return the SILPHIArgument for the given operand.
6830+
/// Return the SILPhiArgument for the given operand.
68316831
///
68326832
/// See SILArgument.cpp.
6833-
const SILPHIArgument *getArgForOperand(const Operand *oper) const;
6833+
const SILPhiArgument *getArgForOperand(const Operand *oper) const;
68346834
};
68356835

68366836
/// A conditional branch.
@@ -6972,14 +6972,14 @@ class CondBranchInst final
69726972
SILValue getArgForDestBB(const SILBasicBlock *DestBB,
69736973
unsigned ArgIndex) const;
69746974

6975-
/// Return the SILPHIArgument from either the true or false destination for
6975+
/// Return the SILPhiArgument from either the true or false destination for
69766976
/// the given operand.
69776977
///
69786978
/// Returns nullptr for an operand with no block argument
69796979
/// (i.e the branch condition).
69806980
///
69816981
/// See SILArgument.cpp.
6982-
const SILPHIArgument *getArgForOperand(const Operand *oper) const;
6982+
const SILPhiArgument *getArgForOperand(const Operand *oper) const;
69836983

69846984
void swapSuccessors();
69856985
};

include/swift/SIL/SILNodes.def

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@
330330
ABSTRACT_NODE(ValueBase, SILNode)
331331

332332
ABSTRACT_VALUE(SILArgument, ValueBase)
333-
ARGUMENT(SILPHIArgument, SILArgument)
333+
ARGUMENT(SILPhiArgument, SILArgument)
334334
ARGUMENT(SILFunctionArgument, SILArgument)
335-
VALUE_RANGE(SILArgument, SILPHIArgument, SILFunctionArgument)
335+
VALUE_RANGE(SILArgument, SILPhiArgument, SILFunctionArgument)
336336

337337
ABSTRACT_VALUE(MultipleValueInstructionResult, ValueBase)
338338
MULTIPLE_VALUE_INST_RESULT(BeginApplyResult, MultipleValueInstructionResult)
@@ -614,7 +614,7 @@ ABSTRACT_VALUE_AND_INST(SingleValueInstruction, ValueBase, SILInstruction)
614614

615615
SINGLE_VALUE_INST_RANGE(SingleValueInstruction, AllocStackInst, KeyPathInst)
616616

617-
NODE_RANGE(ValueBase, SILPHIArgument, KeyPathInst)
617+
NODE_RANGE(ValueBase, SILPhiArgument, KeyPathInst)
618618

619619
// Terminators
620620
ABSTRACT_INST(TermInst, SILInstruction)
@@ -776,7 +776,7 @@ MULTIPLE_VALUE_INST(DestructureTupleInst, destructure_tuple,
776776
INST_RANGE(MultipleValueInstruction, BeginApplyInst, DestructureTupleInst)
777777

778778
NODE_RANGE(SILInstruction, AllocStackInst, DestructureTupleInst)
779-
NODE_RANGE(SILNode, SILPHIArgument, DestructureTupleInst)
779+
NODE_RANGE(SILNode, SILPhiArgument, DestructureTupleInst)
780780

781781
#undef SINGLE_VALUE_INST_RANGE
782782
#undef INST_RANGE

include/swift/SILOptimizer/Utils/Local.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,10 @@ class EdgeThreadingCloner : public BaseThreadingCloner {
358358

359359
// Create block arguments.
360360
for (unsigned ArgIdx : range(EdgeBB->getNumArguments())) {
361-
auto *DestPHIArg = cast<SILPHIArgument>(EdgeBB->getArgument(ArgIdx));
361+
auto *DestPHIArg = cast<SILPhiArgument>(EdgeBB->getArgument(ArgIdx));
362362
assert(BI->getArg(ArgIdx)->getType() == DestPHIArg->getType() &&
363363
"Types must match");
364-
auto *BlockArg = DestBB->createPHIArgument(
364+
auto *BlockArg = DestBB->createPhiArgument(
365365
DestPHIArg->getType(), DestPHIArg->getOwnershipKind());
366366
ValueMap[DestPHIArg] = SILValue(BlockArg);
367367
AvailVals.push_back(std::make_pair(DestPHIArg, BlockArg));

include/swift/SILOptimizer/Utils/SILSSAUpdater.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ namespace llvm {
2424

2525
namespace swift {
2626

27-
class SILPHIArgument;
27+
class SILPhiArgument;
2828
class SILBasicBlock;
2929
class SILType;
3030
class SILUndef;
3131

3232
/// Independent utility that canonicalizes BB arguments by reusing structurally
3333
/// equivalent arguments and replacing the original arguments with casts.
34-
SILValue replaceBBArgWithCast(SILPHIArgument *Arg);
34+
SILValue replaceBBArgWithCast(SILPhiArgument *Arg);
3535

3636
/// This class updates SSA for a set of SIL instructions defined in multiple
3737
/// blocks.
@@ -49,15 +49,15 @@ class SILSSAUpdater {
4949
std::unique_ptr<SILUndef, void(*)(SILUndef *)> PHISentinel;
5050

5151
// If not null updated with inserted 'phi' nodes (SILArgument).
52-
SmallVectorImpl<SILPHIArgument *> *InsertedPHIs;
52+
SmallVectorImpl<SILPhiArgument *> *InsertedPHIs;
5353

5454
// Not copyable.
5555
void operator=(const SILSSAUpdater &) = delete;
5656
SILSSAUpdater(const SILSSAUpdater &) = delete;
5757

5858
public:
5959
explicit SILSSAUpdater(
60-
SmallVectorImpl<SILPHIArgument *> *InsertedPHIs = nullptr);
60+
SmallVectorImpl<SILPhiArgument *> *InsertedPHIs = nullptr);
6161
~SILSSAUpdater();
6262

6363
/// \brief Initialize for a use of a value of type.

lib/IRGen/LoadableByAddress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ static void convertBBArgType(SILBuilder &argBuilder, SILType newSILType,
13461346
SILUndef::get(newSILType, arg->getFunction()->getModule()));
13471347

13481348
arg->replaceAllUsesWith(copyArg);
1349-
arg = arg->getParent()->replacePHIArgument(arg->getIndex(), newSILType,
1349+
arg = arg->getParent()->replacePhiArgument(arg->getIndex(), newSILType,
13501350
arg->getOwnershipKind());
13511351

13521352
copyArg->replaceAllUsesWith(arg);

lib/ParseSIL/ParseSIL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5094,7 +5094,7 @@ bool SILParser::parseSILBasicBlock(SILBuilder &B) {
50945094
return true;
50955095

50965096
BB = getBBForDefinition(BBName, NameLoc);
5097-
// For now, since we always assume that PHIArguments have
5097+
// For now, since we always assume that PhiArguments have
50985098
// ValueOwnershipKind::Any, do not parse or do anything special. Eventually
50995099
// we will parse the convention.
51005100
bool IsEntry = BB->isEntry();
@@ -5126,7 +5126,7 @@ bool SILParser::parseSILBasicBlock(SILBuilder &B) {
51265126
if (IsEntry) {
51275127
Arg = BB->createFunctionArgument(Ty);
51285128
} else {
5129-
Arg = BB->createPHIArgument(Ty, OwnershipKind);
5129+
Arg = BB->createPhiArgument(Ty, OwnershipKind);
51305130
}
51315131
setLocalValue(Arg, Name, NameLoc);
51325132
} while (P.consumeIf(tok::comma));

0 commit comments

Comments
 (0)