File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,7 @@ class SpillPlacement {
52
52
const EdgeBundles *bundles = nullptr ;
53
53
const MachineBlockFrequencyInfo *MBFI = nullptr ;
54
54
55
- static void arrayDeleter (Node *N);
56
- std::unique_ptr<Node[], decltype (&arrayDeleter)> nodes;
55
+ std::unique_ptr<Node[]> nodes;
57
56
58
57
// Nodes that are active in the current computation. Owned by the prepare()
59
58
// caller.
@@ -161,13 +160,15 @@ class SpillPlacement {
161
160
bool invalidate (MachineFunction &MF, const PreservedAnalyses &PA,
162
161
MachineFunctionAnalysisManager::Invalidator &Inv);
163
162
163
+ // Move the default definitions to the implementation
164
+ // so the full definition of Node is available.
165
+ SpillPlacement (SpillPlacement &&);
166
+ ~SpillPlacement ();
167
+
164
168
private:
165
- SpillPlacement () : nodes( nullptr , &arrayDeleter) {} ;
169
+ SpillPlacement ();
166
170
167
- void releaseMemory () {
168
- nodes.reset ();
169
- TodoList.clear ();
170
- }
171
+ void releaseMemory ();
171
172
172
173
void run (MachineFunction &MF, EdgeBundles *Bundles,
173
174
MachineBlockFrequencyInfo *MBFI);
Original file line number Diff line number Diff line change @@ -219,9 +219,13 @@ bool SpillPlacementAnalysis::Result::invalidate(
219
219
Inv.invalidate <MachineBlockFrequencyAnalysis>(MF, PA);
220
220
}
221
221
222
- void SpillPlacement::arrayDeleter (Node *N) {
223
- if (N)
224
- delete[] N;
222
+ SpillPlacement::SpillPlacement () = default;
223
+ SpillPlacement::~SpillPlacement () = default ;
224
+ SpillPlacement::SpillPlacement (SpillPlacement &&) = default;
225
+
226
+ void SpillPlacement::releaseMemory () {
227
+ nodes.reset ();
228
+ TodoList.clear ();
225
229
}
226
230
227
231
void SpillPlacement::run (MachineFunction &mf, EdgeBundles *Bundles,
You can’t perform that action at this time.
0 commit comments