Skip to content

Commit 8719e1b

Browse files
committed
[sil] Change InstructionDestroyer from a SILVisitor into a SILInstructionVisitor.
1. This code is only actually used to destroy instructions. 2. This introduces an invocation of the destructors of arguments. Arguments are always bump ptr allocated and trivial, so this destructor invocation should always be dead.
1 parent 5c58327 commit 8719e1b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/SIL/SILInstruction.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,11 @@ void SILInstruction::dropAllReferences() {
169169
}
170170

171171
namespace {
172-
class InstructionDestroyer : public SILVisitor<InstructionDestroyer> {
173-
public:
174-
#define VALUE(CLASS, PARENT) void visit##CLASS(CLASS *I) { I->~CLASS(); }
172+
class InstructionDestroyer
173+
: public SILInstructionVisitor<InstructionDestroyer> {
174+
public:
175+
#define INST(CLASS, PARENT, TEXTUALNAME, MEMBEHAVIOR, MAYRELEASE) \
176+
void visit##CLASS(CLASS *I) { I->~CLASS(); }
175177
#include "swift/SIL/SILNodes.def"
176178
};
177179
} // end anonymous namespace

0 commit comments

Comments
 (0)