nhaehnle created this revision. nhaehnle added reviewers: arsenm, RKSimon, mehdi_amini, courbet. Herald added subscribers: cfe-commits, wdng. Herald added projects: clang, LLVM. nhaehnle added a parent revision: D83083: DomTree: Remove getChildren() accessor. nhaehnle added a child revision: D83085: DomTree: Remove getRoots() accessor.
It is fully redundant with reset(). Change-Id: I25850b9f08eace757cf03cbb8780e970aca7f51a Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D83084 Files: clang/include/clang/Analysis/Analyses/Dominators.h llvm/include/llvm/Analysis/PostDominators.h llvm/include/llvm/IR/Dominators.h llvm/include/llvm/Support/GenericDomTree.h Index: llvm/include/llvm/Support/GenericDomTree.h =================================================================== --- llvm/include/llvm/Support/GenericDomTree.h +++ llvm/include/llvm/Support/GenericDomTree.h @@ -325,8 +325,6 @@ 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 @@ 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 @@ 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 <class N> Index: llvm/include/llvm/IR/Dominators.h =================================================================== --- llvm/include/llvm/IR/Dominators.h +++ llvm/include/llvm/IR/Dominators.h @@ -277,7 +277,7 @@ AU.setPreservesAll(); } - void releaseMemory() override { DT.releaseMemory(); } + void releaseMemory() override { DT.reset(); } void print(raw_ostream &OS, const Module *M = nullptr) const override; }; Index: llvm/include/llvm/Analysis/PostDominators.h =================================================================== --- llvm/include/llvm/Analysis/PostDominators.h +++ llvm/include/llvm/Analysis/PostDominators.h @@ -88,9 +88,7 @@ AU.setPreservesAll(); } - void releaseMemory() override { - DT.releaseMemory(); - } + void releaseMemory() override { DT.reset(); } void print(raw_ostream &OS, const Module*) const override; }; Index: clang/include/clang/Analysis/Analyses/Dominators.h =================================================================== --- clang/include/clang/Analysis/Analyses/Dominators.h +++ clang/include/clang/Analysis/Analyses/Dominators.h @@ -167,9 +167,7 @@ } /// Releases the memory held by the dominator tree. - virtual void releaseMemory() { - DT.releaseMemory(); - } + virtual void releaseMemory() { DT.reset(); } /// Converts the dominator tree to human readable form. virtual void print(raw_ostream &OS, const llvm::Module* M= nullptr) const {
Index: llvm/include/llvm/Support/GenericDomTree.h =================================================================== --- llvm/include/llvm/Support/GenericDomTree.h +++ llvm/include/llvm/Support/GenericDomTree.h @@ -325,8 +325,6 @@ 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 @@ 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 @@ 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 <class N> Index: llvm/include/llvm/IR/Dominators.h =================================================================== --- llvm/include/llvm/IR/Dominators.h +++ llvm/include/llvm/IR/Dominators.h @@ -277,7 +277,7 @@ AU.setPreservesAll(); } - void releaseMemory() override { DT.releaseMemory(); } + void releaseMemory() override { DT.reset(); } void print(raw_ostream &OS, const Module *M = nullptr) const override; }; Index: llvm/include/llvm/Analysis/PostDominators.h =================================================================== --- llvm/include/llvm/Analysis/PostDominators.h +++ llvm/include/llvm/Analysis/PostDominators.h @@ -88,9 +88,7 @@ AU.setPreservesAll(); } - void releaseMemory() override { - DT.releaseMemory(); - } + void releaseMemory() override { DT.reset(); } void print(raw_ostream &OS, const Module*) const override; }; Index: clang/include/clang/Analysis/Analyses/Dominators.h =================================================================== --- clang/include/clang/Analysis/Analyses/Dominators.h +++ clang/include/clang/Analysis/Analyses/Dominators.h @@ -167,9 +167,7 @@ } /// Releases the memory held by the dominator tree. - virtual void releaseMemory() { - DT.releaseMemory(); - } + virtual void releaseMemory() { DT.reset(); } /// Converts the dominator tree to human readable form. virtual void print(raw_ostream &OS, const llvm::Module* M= nullptr) const {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits