diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h index 801eb3d5967..296110d8d03 100644 --- a/include/llvm/Analysis/PostDominators.h +++ b/include/llvm/Analysis/PostDominators.h @@ -88,9 +88,7 @@ struct PostDominatorTreeWrapperPass : public FunctionPass { AU.setPreservesAll(); } - void releaseMemory() override { - DT.releaseMemory(); - } + void releaseMemory() override { DT.reset(); } void print(raw_ostream &OS, const Module*) const override; }; diff --git a/include/llvm/IR/Dominators.h b/include/llvm/IR/Dominators.h index a79be8779b7..0084ac0b655 100644 --- a/include/llvm/IR/Dominators.h +++ b/include/llvm/IR/Dominators.h @@ -277,7 +277,7 @@ public: AU.setPreservesAll(); } - void releaseMemory() override { DT.releaseMemory(); } + void releaseMemory() override { DT.reset(); } void print(raw_ostream &OS, const Module *M = nullptr) const override; }; diff --git a/include/llvm/Support/GenericDomTree.h b/include/llvm/Support/GenericDomTree.h index d93293864a6..e83e7aa39e7 100644 --- a/include/llvm/Support/GenericDomTree.h +++ b/include/llvm/Support/GenericDomTree.h @@ -325,8 +325,6 @@ protected: return false; } - void releaseMemory() { reset(); } - /// getNode - return the (Post)DominatorTree node for the specified basic /// block. This is the same as using operator[] on this class. The result /// may (but is not required to) be null for a forward (backwards) @@ -760,9 +758,6 @@ public: return DomTreeBuilder::Verify(*this, VL); } -protected: - void addRoot(NodeT *BB) { this->Roots.push_back(BB); } - void reset() { DomTreeNodes.clear(); Roots.clear(); @@ -772,6 +767,9 @@ protected: SlowQueries = 0; } +protected: + void addRoot(NodeT *BB) { this->Roots.push_back(BB); } + // NewBB is split and now it has one successor. Update dominator tree to // reflect this change. template