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 {
5252 const EdgeBundles *bundles = nullptr ;
5353 const MachineBlockFrequencyInfo *MBFI = nullptr ;
5454
55- static void arrayDeleter (Node *N);
56- std::unique_ptr<Node[], decltype (&arrayDeleter)> nodes;
55+ std::unique_ptr<Node[]> nodes;
5756
5857 // Nodes that are active in the current computation. Owned by the prepare()
5958 // caller.
@@ -161,13 +160,15 @@ class SpillPlacement {
161160 bool invalidate (MachineFunction &MF, const PreservedAnalyses &PA,
162161 MachineFunctionAnalysisManager::Invalidator &Inv);
163162
163+ // Move the default definitions to the implementation
164+ // so the full definition of Node is available.
165+ SpillPlacement (SpillPlacement &&);
166+ ~SpillPlacement ();
167+
164168private:
165- SpillPlacement () : nodes( nullptr , &arrayDeleter) {} ;
169+ SpillPlacement ();
166170
167- void releaseMemory () {
168- nodes.reset ();
169- TodoList.clear ();
170- }
171+ void releaseMemory ();
171172
172173 void run (MachineFunction &MF, EdgeBundles *Bundles,
173174 MachineBlockFrequencyInfo *MBFI);
Original file line number Diff line number Diff line change @@ -219,9 +219,13 @@ bool SpillPlacementAnalysis::Result::invalidate(
219219 Inv.invalidate <MachineBlockFrequencyAnalysis>(MF, PA);
220220}
221221
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 ();
225229}
226230
227231void SpillPlacement::run (MachineFunction &mf, EdgeBundles *Bundles,
You can’t perform that action at this time.
0 commit comments