From 5d32ec4cb002973cb12bc21a3fe12364794168c8 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 31 Oct 2007 03:30:14 +0000 Subject: Some fixes to get MachineDomTree working better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43541 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineDominators.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'include/llvm/CodeGen/MachineDominators.h') 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::addRoot(MachineBasicBlock* MBB) { + this->Roots.push_back(MBB); +} + +EXTERN_TEMPLATE_INSTANTIATION(class DomTreeNodeBase); +EXTERN_TEMPLATE_INSTANTIATION(class DominatorTreeBase); + +typedef DomTreeNodeBase 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(); -- cgit v1.2.3