Representation of return statement, e.g., return; or return x.
| 32 | * Representation of return statement, e.g., return; or return x. |
| 33 | */ |
| 34 | public class Return extends AbstractStmt { |
| 35 | |
| 36 | @Nullable |
| 37 | private final Var value; |
| 38 | |
| 39 | public Return(@Nullable Var value) { |
| 40 | this.value = value; |
| 41 | } |
| 42 | |
| 43 | public Return() { |
| 44 | this(null); |
| 45 | } |
| 46 | |
| 47 | @Nullable |
| 48 | public Var getValue() { |
| 49 | return value; |
| 50 | } |
| 51 | |
| 52 | @Override |
| 53 | public Set<RValue> getUses() { |
| 54 | return value != null ? Set.of(value) : Set.of(); |
| 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public boolean canFallThrough() { |
| 59 | return false; |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public <T> T accept(StmtVisitor<T> visitor) { |
| 64 | return visitor.visit(this); |
| 65 | } |
| 66 | |
| 67 | @Override |
| 68 | public String toString() { |
| 69 | return value != null ? "return " + value : "return"; |
| 70 | } |
| 71 | } |
nothing calls this directly
no outgoing calls
no test coverage detected