Skip to content

Commit

Permalink
SIL: add a clarifying comment to the SILArgument::getIncomingValue fu…
Browse files Browse the repository at this point in the history
…nctions
  • Loading branch information
eeckstein committed May 13, 2016
1 parent f424b27 commit 6e75735
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions include/swift/SIL/SILArgument.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,38 @@ class SILArgument : public ValueBase {

/// Returns the incoming SILValue from the \p BBIndex predecessor of this
/// argument's parent BB. If the routine fails, it returns an empty SILValue.
/// Note that for some predecessor terminators the incoming value is not
/// exactly the argument value. E.g. the incoming value for a switch_enum
/// payload argument is the enum itself (the operand of the switch_enum).
SILValue getIncomingValue(unsigned BBIndex);

/// Returns the incoming SILValue for this argument from BB. If the routine
/// fails, it returns an empty SILValue.
/// Note that for some predecessor terminators the incoming value is not
/// exactly the argument value. E.g. the incoming value for a switch_enum
/// payload argument is the enum itself (the operand of the switch_enum).
SILValue getIncomingValue(SILBasicBlock *BB);

/// Returns true if we were able to find incoming values for each predecessor
/// of this arguments basic block. The found values are stored in OutArray.
/// Note that for some predecessor terminators the incoming value is not
/// exactly the argument value. E.g. the incoming value for a switch_enum
/// payload argument is the enum itself (the operand of the switch_enum).
bool getIncomingValues(llvm::SmallVectorImpl<SILValue> &OutArray);

/// Returns true if we were able to find incoming values for each predecessor
/// of this arguments basic block. The found values are stored in OutArray.
/// Note that for some predecessor terminators the incoming value is not
/// exactly the argument value. E.g. the incoming value for a switch_enum
/// payload argument is the enum itself (the operand of the switch_enum).
bool getIncomingValues(
llvm::SmallVectorImpl<std::pair<SILBasicBlock *, SILValue>> &OutArray);

/// If this SILArgument's parent block has one predecessor, return the
/// incoming value from that predecessor. Returns SILValue() otherwise.
/// Note that for some predecessor terminators the incoming value is not
/// exactly the argument value. E.g. the incoming value for a switch_enum
/// payload argument is the enum itself (the operand of the switch_enum).
SILValue getSingleIncomingValue() const;

/// Returns true if this SILArgument is the self argument of its
Expand Down

0 comments on commit 6e75735

Please sign in to comment.