[llvm] ad0d3bb - [Dominators] Facilitate updates to MachinePostDominatorTree
Carl Ritson via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 18 18:06:17 PDT 2020
Author: Carl Ritson
Date: 2020-04-19T10:04:35+09:00
New Revision: ad0d3bbb279b0310a9e53cfc0c162f21333fc098
URL: https://github.com/llvm/llvm-project/commit/ad0d3bbb279b0310a9e53cfc0c162f21333fc098
DIFF: https://github.com/llvm/llvm-project/commit/ad0d3bbb279b0310a9e53cfc0c162f21333fc098.diff
LOG: [Dominators] Facilitate updates to MachinePostDominatorTree
Summary:
Add getBase accessor so that underlying tree can be
manipulated in a similar manner to MachineDominatorTree.
Reviewers: kuhar, arsenm, hliao, nhaehnle
Reviewed By: kuhar
Subscribers: lkail, mgorny, hiraditya, wdng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77967
Added:
Modified:
llvm/include/llvm/CodeGen/MachinePostDominators.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/MachinePostDominators.h b/llvm/include/llvm/CodeGen/MachinePostDominators.h
index cb258b5e7b21..597bb401a7fa 100644
--- a/llvm/include/llvm/CodeGen/MachinePostDominators.h
+++ b/llvm/include/llvm/CodeGen/MachinePostDominators.h
@@ -33,6 +33,12 @@ class MachinePostDominatorTree : public MachineFunctionPass {
MachinePostDominatorTree();
+ PostDomTreeT &getBase() {
+ if (!PDT)
+ PDT.reset(new PostDomTreeT());
+ return *PDT;
+ }
+
FunctionPass *createMachinePostDominatorTreePass();
const SmallVectorImpl<MachineBasicBlock *> &getRoots() const {
More information about the llvm-commits
mailing list