Skip to content

Commit a232e1f

Browse files
author
Joe Shajrawi
committed
[SILMem2Reg] add an assert when replacing debug_value_addr with debug_value: make sure it is not an address-only type
1 parent 5e23833 commit a232e1f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ bool MemoryToRegisters::isWriteOnlyAllocation(AllocStackInst *ASI) {
277277
/// Promote a DebugValueAddr to a DebugValue of the given value.
278278
static void
279279
promoteDebugValueAddr(DebugValueAddrInst *DVAI, SILValue Value, SILBuilder &B) {
280+
assert(DVAI->getOperand()->getType().isLoadable(DVAI->getModule()) &&
281+
"Unexpected promotion of address-only type!");
280282
assert(Value && "Expected valid value");
281283
B.setInsertionPoint(DVAI);
282284
B.setCurrentDebugScope(DVAI->getDebugScope());

0 commit comments

Comments
 (0)