File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ class InstructionVisitor : public SILCloner<InstructionVisitor> {
101
101
102
102
private:
103
103
CrossModuleSerializationSetup &CMS;
104
+ SILInstruction *result = nullptr ;
104
105
105
106
public:
106
107
InstructionVisitor (SILFunction *F, CrossModuleSerializationSetup &CMS) :
@@ -122,8 +123,8 @@ class InstructionVisitor : public SILCloner<InstructionVisitor> {
122
123
}
123
124
124
125
void postProcess (SILInstruction *Orig, SILInstruction *Cloned) {
125
- SILInstruction::destroy ( Cloned) ;
126
- Orig-> getFunction ()-> getModule (). deallocateInst ( Cloned);
126
+ result = Cloned;
127
+ SILCloner<InstructionVisitor>:: postProcess (Orig, Cloned);
127
128
}
128
129
129
130
SILValue getMappedValue (SILValue Value) { return Value; }
@@ -133,6 +134,9 @@ class InstructionVisitor : public SILCloner<InstructionVisitor> {
133
134
static void visitInst (SILInstruction *I, CrossModuleSerializationSetup &CMS) {
134
135
InstructionVisitor visitor (I->getFunction (), CMS);
135
136
visitor.visit (I);
137
+
138
+ SILInstruction::destroy (visitor.result );
139
+ CMS.M .deallocateInst (visitor.result );
136
140
}
137
141
};
138
142
You can’t perform that action at this time.
0 commit comments