-// Provide overrides for Loop methods that don't make sense for machine loops.
-template<>
-PHINode *LoopBase<MachineBasicBlock>::getCanonicalInductionVariable() const {
- assert(0 && "getCanonicalInductionVariable not supported for machine loops!");
- return 0;
-}
-
-template<>
-Instruction*
-LoopBase<MachineBasicBlock>::getCanonicalInductionVariableIncrement() const {
- assert(0 &&
- "getCanonicalInductionVariableIncrement not supported for machine loops!");
- return 0;
-}
-
-template<>
-bool LoopBase<MachineBasicBlock>::isLoopInvariant(Value *V) const {
- assert(0 && "isLoopInvariant not supported for machine loops!");
- return false;
-}
-
-template<>
-Value *LoopBase<MachineBasicBlock>::getTripCount() const {
- assert(0 && "getTripCount not supported for machine loops!");
- return 0;
-}
-
-template<>
-bool LoopBase<MachineBasicBlock>::isLCSSAForm() const {
- assert(0 && "isLCSSAForm not supported for machine loops");
- return false;
-}
-
-EXTERN_TEMPLATE_INSTANTIATION(class LoopBase<MachineBasicBlock>);
-EXTERN_TEMPLATE_INSTANTIATION(class LoopInfoBase<MachineBasicBlock>);
-
-typedef LoopBase<MachineBasicBlock> MachineLoop;
+// Implementation in LoopInfoImpl.h
+#ifdef __GNUC__
+class MachineLoop;
+__extension__ extern template class LoopBase<MachineBasicBlock, MachineLoop>;
+#endif
+
+class MachineLoop : public LoopBase<MachineBasicBlock, MachineLoop> {
+public:
+ MachineLoop();
+
+ /// getTopBlock - Return the "top" block in the loop, which is the first
+ /// block in the linear layout, ignoring any parts of the loop not
+ /// contiguous with the part the contains the header.
+ MachineBasicBlock *getTopBlock();
+
+ /// getBottomBlock - Return the "bottom" block in the loop, which is the last
+ /// block in the linear layout, ignoring any parts of the loop not
+ /// contiguous with the part the contains the header.
+ MachineBasicBlock *getBottomBlock();
+
+ void dump() const;
+
+private:
+ friend class LoopInfoBase<MachineBasicBlock, MachineLoop>;
+ explicit MachineLoop(MachineBasicBlock *MBB)
+ : LoopBase<MachineBasicBlock, MachineLoop>(MBB) {}
+};
+
+// Implementation in LoopInfoImpl.h
+#ifdef __GNUC__
+__extension__ extern template
+class LoopInfoBase<MachineBasicBlock, MachineLoop>;
+#endif