Skip to content

Commit ed78fe0

Browse files
authored
Merge pull request #66304 from meg-gupta/fixcreateallocboxpr
Remove #ifndef on skipVarDeclAssert in SILBuilder::createAllocBox signature
2 parents 20476b1 + f08720b commit ed78fe0

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

include/swift/SIL/SILBuilder.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,9 @@ class SILBuilder {
489489
#endif
490490
llvm::SmallString<4> Name;
491491
Loc.markAsPrologue();
492+
#if defined(NDEBUG)
493+
(void) skipVarDeclAssert;
494+
#endif
492495
assert((skipVarDeclAssert ||
493496
!dyn_cast_or_null<VarDecl>(Loc.getAsASTNode<Decl>()) || Var) &&
494497
"location is a VarDecl, but SILDebugVariable is empty");

include/swift/SIL/SILCloner.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -955,11 +955,9 @@ SILCloner<ImplClass>::visitAllocBoxInst(AllocBoxInst *Inst) {
955955
Inst,
956956
getBuilder().createAllocBox(
957957
Loc, this->getOpType(Inst->getType()).template castTo<SILBoxType>(),
958-
VarInfo, false, false, false
959-
#ifndef NDEBUG
960-
,
961-
true
962-
#endif
958+
VarInfo, /*hasDynamicLifetime*/ false,
959+
/*reflection*/ false,
960+
/*usesMoveableValueDebugInfo*/ false, /*skipVarDeclAssert*/ true
963961
));
964962
}
965963

lib/SILGen/SILGenDecl.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -519,12 +519,10 @@ class LocalVariableInitialization : public SingleBufferInitialization {
519519
Optional<SILDebugVariable> DbgVar;
520520
if (generateDebugInfo)
521521
DbgVar = SILDebugVariable(decl->isLet(), ArgNo);
522-
Box = SGF.B.createAllocBox(decl, boxType, DbgVar, false, false, false
523-
#ifndef NDEBUG
524-
,
525-
!generateDebugInfo
526-
#endif
527-
);
522+
Box = SGF.B.createAllocBox(
523+
decl, boxType, DbgVar, /*hasDynamicLifetime*/ false,
524+
/*reflection*/ false, /*usesMoveableValueDebugInfo*/ false,
525+
!generateDebugInfo);
528526

529527
// Mark the memory as uninitialized, so DI will track it for us.
530528
if (kind)

0 commit comments

Comments
 (0)