summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineDominators.h
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-10-31 03:30:14 +0000
committerOwen Anderson <resistor@mac.com>2007-10-31 03:30:14 +0000
commit5d32ec4cb002973cb12bc21a3fe12364794168c8 (patch)
treeebca322bece8d476925a3af6749f09ccc2f988c1 /include/llvm/CodeGen/MachineDominators.h
parent25f1d08619720b82e7c944b18eee488fc07ba153 (diff)
downloadllvm-5d32ec4cb002973cb12bc21a3fe12364794168c8.tar.gz
llvm-5d32ec4cb002973cb12bc21a3fe12364794168c8.tar.bz2
llvm-5d32ec4cb002973cb12bc21a3fe12364794168c8.tar.xz
Some fixes to get MachineDomTree working better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43541 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineDominators.h')
-rw-r--r--include/llvm/CodeGen/MachineDominators.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/MachineDominators.h b/include/llvm/CodeGen/MachineDominators.h
index 621ba2f7a1..353c0e4301 100644
--- a/include/llvm/CodeGen/MachineDominators.h
+++ b/include/llvm/CodeGen/MachineDominators.h
@@ -24,7 +24,17 @@
namespace llvm {
-void WriteAsOperand(std::ostream &, const MachineBasicBlock*, bool t) { }
+inline void WriteAsOperand(std::ostream &, const MachineBasicBlock*, bool t) { }
+
+template<>
+inline void DominatorTreeBase<MachineBasicBlock>::addRoot(MachineBasicBlock* MBB) {
+ this->Roots.push_back(MBB);
+}
+
+EXTERN_TEMPLATE_INSTANTIATION(class DomTreeNodeBase<MachineBasicBlock>);
+EXTERN_TEMPLATE_INSTANTIATION(class DominatorTreeBase<MachineBasicBlock>);
+
+typedef DomTreeNodeBase<MachineBasicBlock> MachineDomTreeNode;
//===-------------------------------------
/// DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to
@@ -60,7 +70,11 @@ public:
return DT->getRootNode();
}
- virtual bool runOnFunction(Function &F);
+ virtual bool runOnMachineFunction(MachineFunction &F) {
+ DT->recalculate(F);
+
+ return false;
+ }
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();