Skip to content

Remove #ifndef on skipVarDeclAssert in SILBuilder::createAllocBox signature #66304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/swift/SIL/SILBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -480,14 +480,14 @@ class SILBuilder {
Optional<SILDebugVariable> Var = None,
bool hasDynamicLifetime = false,
bool reflection = false,
bool usesMoveableValueDebugInfo = false
#ifndef NDEBUG
,
bool usesMoveableValueDebugInfo = false,
bool skipVarDeclAssert = false,
#endif
bool hasPointerEscape = false) {
llvm::SmallString<4> Name;
Loc.markAsPrologue();
#if defined(NDEBUG)
(void) skipVarDeclAssert;
#endif
assert((skipVarDeclAssert ||
!dyn_cast_or_null<VarDecl>(Loc.getAsASTNode<Decl>()) || Var) &&
"location is a VarDecl, but SILDebugVariable is empty");
Expand Down
8 changes: 3 additions & 5 deletions include/swift/SIL/SILCloner.h
Original file line number Diff line number Diff line change
Expand Up @@ -955,11 +955,9 @@ SILCloner<ImplClass>::visitAllocBoxInst(AllocBoxInst *Inst) {
Inst,
getBuilder().createAllocBox(
Loc, this->getOpType(Inst->getType()).template castTo<SILBoxType>(),
VarInfo, false, false, false
#ifndef NDEBUG
,
true
#endif
VarInfo, /*hasDynamicLifetime*/ false,
/*reflection*/ false,
/*usesMoveableValueDebugInfo*/ false, /*skipVarDeclAssert*/ true
));
}

Expand Down
10 changes: 4 additions & 6 deletions lib/SILGen/SILGenDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,10 @@ class LocalVariableInitialization : public SingleBufferInitialization {
Optional<SILDebugVariable> DbgVar;
if (generateDebugInfo)
DbgVar = SILDebugVariable(decl->isLet(), ArgNo);
Box = SGF.B.createAllocBox(decl, boxType, DbgVar, false, false, false
#ifndef NDEBUG
,
!generateDebugInfo
#endif
);
Box = SGF.B.createAllocBox(
decl, boxType, DbgVar, /*hasDynamicLifetime*/ false,
/*reflection*/ false, /*usesMoveableValueDebugInfo*/ false,
!generateDebugInfo);

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