Skip to content

Commit 5db0339

Browse files
committed
[SIL] tuple_addr_constructor reqs lowered addrs.
The instruction exists to express the atomic initialization of a tuple-typed address in address-lowered mode. In opaque-values mode, this is expressed as an assign/store.
1 parent 2bc509a commit 5db0339

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

include/swift/SIL/SILBuilder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,6 +1672,7 @@ class SILBuilder {
16721672
createTupleAddrConstructor(SILLocation Loc, SILValue DestAddr,
16731673
ArrayRef<SILValue> Elements,
16741674
IsInitialization_t IsInitOfDest) {
1675+
assert(getFunction().getModule().useLoweredAddresses());
16751676
return insert(TupleAddrConstructorInst::create(getSILDebugLocation(Loc),
16761677
DestAddr, Elements,
16771678
IsInitOfDest, getModule()));

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3338,6 +3338,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
33383338
}
33393339

33403340
void checkTupleAddrConstructorInst(TupleAddrConstructorInst *taci) {
3341+
require(F.getModule().useLoweredAddresses(),
3342+
"tuple_addr_constructor is invalid in opaque values");
33413343
require(taci->getNumElements() > 0,
33423344
"Cannot be applied to tuples that do not contain any real "
33433345
"elements. E.x.: ((), ())");

0 commit comments

Comments
 (0)