Skip to content

Commit 32cb943

Browse files
committed
[sil] Add a small helper API called SILUndef::get(SILValue).
This just creates a new SILUndef with the same type as the SILValue. This just prevents one from having to write SILUndef::get(value->getType(), *value->getModule()). (cherry picked from commit 92116ba)
1 parent 9749a60 commit 32cb943

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/swift/SIL/SILUndef.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ class SILUndef : public ValueBase {
3030
void operator delete(void *, size_t) = delete;
3131

3232
static SILUndef *get(SILType ty, SILModule &m);
33+
34+
/// Return a SILUndef with the same type as the passed in value.
35+
static SILUndef *get(SILValue value) {
36+
return SILUndef::get(value->getType(), *value->getModule());
37+
}
38+
3339
static SILUndef *get(SILType ty, const SILFunction &f);
3440

3541
template <class OwnerTy>

0 commit comments

Comments
 (0)