@@ -181,6 +181,10 @@ class SILArgument : public ValueBase {
181
181
// / terminator has a single operand, return that terminator.
182
182
TermInst *getSingleTerminator () const ;
183
183
184
+ // / Return the terminator instruction for which this argument is a result,
185
+ // / otherwise return nullptr.
186
+ TermInst *getTerminatorForResultArg () const ;
187
+
184
188
// / Return the SILArgumentKind of this argument.
185
189
SILArgumentKind getKind () const {
186
190
return SILArgumentKind (ValueBase::getKind ());
@@ -289,9 +293,9 @@ class SILPhiArgument : public SILArgument {
289
293
// / terminator has a single operand, return that terminator.
290
294
TermInst *getSingleTerminator () const ;
291
295
292
- // / Return the terminator instruction of which this argument is a result or
293
- // / nullptr.
294
- TermInst *getTransformingTerminator () const ;
296
+ // / Return the terminator instruction for which this argument is a result,
297
+ // / otherwise return nullptr.
298
+ TermInst *getTerminatorForResultArg () const ;
295
299
296
300
static bool classof (const SILInstruction *) = delete;
297
301
static bool classof (const SILUndef *) = delete;
@@ -437,6 +441,16 @@ inline TermInst *SILArgument::getSingleTerminator() const {
437
441
llvm_unreachable (" Covered switch is not covered?!" );
438
442
}
439
443
444
+ inline TermInst *SILArgument::getTerminatorForResultArg () const {
445
+ switch (getKind ()) {
446
+ case SILArgumentKind::SILPhiArgument:
447
+ return cast<SILPhiArgument>(this )->getTerminatorForResultArg ();
448
+ case SILArgumentKind::SILFunctionArgument:
449
+ return nullptr ;
450
+ }
451
+ llvm_unreachable (" Covered switch is not covered?!" );
452
+ }
453
+
440
454
inline bool SILArgument::getIncomingPhiOperands (
441
455
SmallVectorImpl<Operand *> &returnedPhiOperands) const {
442
456
switch (getKind ()) {
0 commit comments