File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,10 @@ static bool isDestroyArray(SILInstruction *inst) {
127
127
// / Analyze the destructor for the class of ARI to see if any instructions in it
128
128
// / could have side effects on the program outside the destructor. If it does
129
129
// / not, then we can eliminate the destructor.
130
+ // / TODO: Most default destructors with non-trivial elements will have a
131
+ // / destroy_addr of the non-trivial element in the destructor, this analysis
132
+ // / will return as having side-effects in such cases, leading to conservative
133
+ // / results. Check if we can do better here.
130
134
static DestructorEffects doesDestructorHaveSideEffects (AllocRefInstBase *ARI) {
131
135
SILFunction *Fn = getDestructor (ARI);
132
136
// If we can't find a constructor then assume it has side effects.
You can’t perform that action at this time.
0 commit comments