diff options
Diffstat (limited to 'include/llvm/CodeGen/MachineLoopInfo.h')
-rw-r--r-- | include/llvm/CodeGen/MachineLoopInfo.h | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/include/llvm/CodeGen/MachineLoopInfo.h b/include/llvm/CodeGen/MachineLoopInfo.h index 2d19d7a..65ad4e4 100644 --- a/include/llvm/CodeGen/MachineLoopInfo.h +++ b/include/llvm/CodeGen/MachineLoopInfo.h @@ -35,48 +35,23 @@ namespace llvm { -// Provide overrides for Loop methods that don't make sense for machine loops. -template<> inline -PHINode *LoopBase<MachineBasicBlock>::getCanonicalInductionVariable() const { - assert(0 && "getCanonicalInductionVariable not supported for machine loops!"); - return 0; -} - -template<> inline Instruction* -LoopBase<MachineBasicBlock>::getCanonicalInductionVariableIncrement() const { - assert(0 && - "getCanonicalInductionVariableIncrement not supported for machine loops!"); - return 0; -} - -template<> -inline bool LoopBase<MachineBasicBlock>::isLoopInvariant(Value *V) const { - assert(0 && "isLoopInvariant not supported for machine loops!"); - return false; -} - -template<> -inline Value *LoopBase<MachineBasicBlock>::getTripCount() const { - assert(0 && "getTripCount not supported for machine loops!"); - return 0; -} - -template<> -inline bool LoopBase<MachineBasicBlock>::isLCSSAForm() const { - assert(0 && "isLCSSAForm not supported for machine loops"); - return false; -} - -typedef LoopBase<MachineBasicBlock> MachineLoop; +class MachineLoop : public LoopBase<MachineBasicBlock, MachineLoop> { +public: + MachineLoop(); +private: + friend class LoopInfoBase<MachineBasicBlock, MachineLoop>; + explicit MachineLoop(MachineBasicBlock *MBB) + : LoopBase<MachineBasicBlock, MachineLoop>(MBB) {} +}; class MachineLoopInfo : public MachineFunctionPass { - LoopInfoBase<MachineBasicBlock> LI; - friend class LoopBase<MachineBasicBlock>; + LoopInfoBase<MachineBasicBlock, MachineLoop> LI; + friend class LoopBase<MachineBasicBlock, MachineLoop>; void operator=(const MachineLoopInfo &); // do not implement MachineLoopInfo(const MachineLoopInfo &); // do not implement - LoopInfoBase<MachineBasicBlock>& getBase() { return LI; } + LoopInfoBase<MachineBasicBlock, MachineLoop>& getBase() { return LI; } public: static char ID; // Pass identification, replacement for typeid @@ -86,7 +61,7 @@ public: /// iterator/begin/end - The interface to the top-level loops in the current /// function. /// - typedef LoopInfoBase<MachineBasicBlock>::iterator iterator; + typedef LoopInfoBase<MachineBasicBlock, MachineLoop>::iterator iterator; inline iterator begin() const { return LI.begin(); } inline iterator end() const { return LI.end(); } bool empty() const { return LI.empty(); } |