@@ -127,22 +127,22 @@ class SILArgument : public ValueBase {
127
127
128
128
// / Return true if this block argument is actually a phi argument as
129
129
// / opposed to a cast or projection.
130
- bool isPhiArgument ();
130
+ bool isPhiArgument () const ;
131
131
132
132
// / If this argument is a phi, return the incoming phi value for the given
133
133
// / predecessor BB. If this argument is not a phi, return an invalid SILValue.
134
- SILValue getIncomingPhiValue (SILBasicBlock *predBlock);
134
+ SILValue getIncomingPhiValue (SILBasicBlock *predBlock) const ;
135
135
136
136
// / If this argument is a phi, populate `OutArray` with the incoming phi
137
137
// / values for each predecessor BB. If this argument is not a phi, return
138
138
// / false.
139
- bool getIncomingPhiValues (SmallVectorImpl<SILValue> &returnedPhiValues);
139
+ bool getIncomingPhiValues (SmallVectorImpl<SILValue> &returnedPhiValues) const ;
140
140
141
141
// / If this argument is a phi, populate `OutArray` with each predecessor block
142
142
// / and its incoming phi value. If this argument is not a phi, return false.
143
143
bool
144
144
getIncomingPhiValues (SmallVectorImpl<std::pair<SILBasicBlock *, SILValue>>
145
- &returnedPredAndPhiValuePairs);
145
+ &returnedPredAndPhiValuePairs) const ;
146
146
147
147
// / Returns true if we were able to find a single terminator operand value for
148
148
// / each predecessor of this arguments basic block. The found values are
@@ -152,7 +152,7 @@ class SILArgument : public ValueBase {
152
152
// / terminator. e.g. the incoming value for a switch_enum payload argument is
153
153
// / the enum itself (the operand of the switch_enum).
154
154
bool getSingleTerminatorOperands (
155
- SmallVectorImpl<SILValue> &returnedSingleTermOperands);
155
+ SmallVectorImpl<SILValue> &returnedSingleTermOperands) const ;
156
156
157
157
// / Returns true if we were able to find single terminator operand values for
158
158
// / each predecessor of this arguments basic block. The found values are
@@ -163,7 +163,7 @@ class SILArgument : public ValueBase {
163
163
// / the enum itself (the operand of the switch_enum).
164
164
bool getSingleTerminatorOperands (
165
165
SmallVectorImpl<std::pair<SILBasicBlock *, SILValue>>
166
- &returnedSingleTermOperands);
166
+ &returnedSingleTermOperands) const ;
167
167
168
168
// / If this SILArgument's parent block has a single predecessor whose
169
169
// / terminator has a single operand, return the incoming operand of the
@@ -209,22 +209,22 @@ class SILPhiArgument : public SILArgument {
209
209
public:
210
210
// / Return true if this is block argument is actually a phi argument as
211
211
// / opposed to a cast or projection.
212
- bool isPhiArgument ();
212
+ bool isPhiArgument () const ;
213
213
214
214
// / If this argument is a phi, return the incoming phi value for the given
215
215
// / predecessor BB. If this argument is not a phi, return an invalid SILValue.
216
216
// /
217
217
// / FIXME: Once SILPhiArgument actually implies that it is a phi argument,
218
218
// / this will be guaranteed to return a valid SILValue.
219
- SILValue getIncomingPhiValue (SILBasicBlock *predBlock);
219
+ SILValue getIncomingPhiValue (SILBasicBlock *predBlock) const ;
220
220
221
221
// / If this argument is a phi, populate `OutArray` with the incoming phi
222
222
// / values for each predecessor BB. If this argument is not a phi, return
223
223
// / false.
224
224
// /
225
225
// / FIXME: Once SILPhiArgument actually implies that it is a phi argument,
226
226
// / this will always succeed.
227
- bool getIncomingPhiValues (SmallVectorImpl<SILValue> &returnedPhiValues);
227
+ bool getIncomingPhiValues (SmallVectorImpl<SILValue> &returnedPhiValues) const ;
228
228
229
229
// / If this argument is a phi, populate `OutArray` with each predecessor block
230
230
// / and its incoming phi value. If this argument is not a phi, return false.
@@ -233,7 +233,7 @@ class SILPhiArgument : public SILArgument {
233
233
// / this will always succeed.
234
234
bool
235
235
getIncomingPhiValues (SmallVectorImpl<std::pair<SILBasicBlock *, SILValue>>
236
- &returnedPredAndPhiValuePairs);
236
+ &returnedPredAndPhiValuePairs) const ;
237
237
238
238
// / Returns true if we were able to find a single terminator operand value for
239
239
// / each predecessor of this arguments basic block. The found values are
@@ -243,7 +243,7 @@ class SILPhiArgument : public SILArgument {
243
243
// / terminator. e.g. the incoming value for a switch_enum payload argument is
244
244
// / the enum itself (the operand of the switch_enum).
245
245
bool getSingleTerminatorOperands (
246
- SmallVectorImpl<SILValue> &returnedSingleTermOperands);
246
+ SmallVectorImpl<SILValue> &returnedSingleTermOperands) const ;
247
247
248
248
// / Returns true if we were able to find single terminator operand values for
249
249
// / each predecessor of this arguments basic block. The found values are
@@ -254,7 +254,7 @@ class SILPhiArgument : public SILArgument {
254
254
// / the enum itself (the operand of the switch_enum).
255
255
bool getSingleTerminatorOperands (
256
256
SmallVectorImpl<std::pair<SILBasicBlock *, SILValue>>
257
- &returnedSingleTermOperands);
257
+ &returnedSingleTermOperands) const ;
258
258
259
259
// / If this SILArgument's parent block has a single predecessor whose
260
260
// / terminator has a single operand, return the incoming operand of the
@@ -333,37 +333,38 @@ class SILFunctionArgument : public SILArgument {
333
333
// Out of line Definitions for SILArgument to avoid Forward Decl issues
334
334
// ===----------------------------------------------------------------------===//
335
335
336
- inline bool SILArgument::isPhiArgument () {
336
+ inline bool SILArgument::isPhiArgument () const {
337
337
if (auto *phiArg = dyn_cast<SILPhiArgument>(this ))
338
338
return phiArg->isPhiArgument ();
339
339
340
340
return false ;
341
341
}
342
342
343
- inline SILValue SILArgument::getIncomingPhiValue (SILBasicBlock *predBlock) {
343
+ inline SILValue
344
+ SILArgument::getIncomingPhiValue (SILBasicBlock *predBlock) const {
344
345
if (isa<SILFunctionArgument>(this ))
345
346
return SILValue ();
346
347
return cast<SILPhiArgument>(this )->getIncomingPhiValue (predBlock);
347
348
}
348
349
349
350
inline bool SILArgument::getIncomingPhiValues (
350
- SmallVectorImpl<SILValue> &returnedPhiValues) {
351
+ SmallVectorImpl<SILValue> &returnedPhiValues) const {
351
352
if (isa<SILFunctionArgument>(this ))
352
353
return false ;
353
354
return cast<SILPhiArgument>(this )->getIncomingPhiValues (returnedPhiValues);
354
355
}
355
356
356
357
inline bool SILArgument::getIncomingPhiValues (
357
358
SmallVectorImpl<std::pair<SILBasicBlock *, SILValue>>
358
- &returnedPredAndPhiValuePairs) {
359
+ &returnedPredAndPhiValuePairs) const {
359
360
if (isa<SILFunctionArgument>(this ))
360
361
return false ;
361
362
return cast<SILPhiArgument>(this )->getIncomingPhiValues (
362
363
returnedPredAndPhiValuePairs);
363
364
}
364
365
365
366
inline bool SILArgument::getSingleTerminatorOperands (
366
- SmallVectorImpl<SILValue> &returnedSingleTermOperands) {
367
+ SmallVectorImpl<SILValue> &returnedSingleTermOperands) const {
367
368
if (isa<SILFunctionArgument>(this ))
368
369
return false ;
369
370
return cast<SILPhiArgument>(this )->getSingleTerminatorOperands (
@@ -372,7 +373,7 @@ inline bool SILArgument::getSingleTerminatorOperands(
372
373
373
374
inline bool SILArgument::getSingleTerminatorOperands (
374
375
SmallVectorImpl<std::pair<SILBasicBlock *, SILValue>>
375
- &returnedSingleTermOperands) {
376
+ &returnedSingleTermOperands) const {
376
377
if (isa<SILFunctionArgument>(this ))
377
378
return false ;
378
379
return cast<SILPhiArgument>(this )->getSingleTerminatorOperands (
0 commit comments