diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index 453633b3050..14d87e0034b 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -316,6 +316,11 @@ raw_ostream& operator<<(raw_ostream &OS, const LoopBase &Loop) { return OS; } +// Implementation in LoopInfoImpl.h +#ifdef __GNUC__ +__extension__ extern template class LoopBase; +#endif + class Loop : public LoopBase { public: Loop() {} @@ -541,6 +546,11 @@ public: void print(raw_ostream &OS) const; }; +// Implementation in LoopInfoImpl.h +#ifdef __GNUC__ +__extension__ extern template class LoopInfoBase; +#endif + class LoopInfo : public FunctionPass { LoopInfoBase LI; friend class LoopBase; diff --git a/include/llvm/CodeGen/MachineLoopInfo.h b/include/llvm/CodeGen/MachineLoopInfo.h index 6dd9440500b..3e204bed15a 100644 --- a/include/llvm/CodeGen/MachineLoopInfo.h +++ b/include/llvm/CodeGen/MachineLoopInfo.h @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file defines the MachineLoopInfo class that is used to identify natural +// This file defines the MachineLoopInfo class that is used to identify natural // loops and determine the loop depth of various nodes of the CFG. Note that // natural loops may actually be several loops that share the same header node. // @@ -35,6 +35,12 @@ namespace llvm { +// Implementation in LoopInfoImpl.h +#ifdef __GNUC__ +class MachineLoop; +__extension__ extern template class LoopBase; +#endif + class MachineLoop : public LoopBase { public: MachineLoop(); @@ -57,6 +63,12 @@ private: : LoopBase(MBB) {} }; +// Implementation in LoopInfoImpl.h +#ifdef __GNUC__ +__extension__ extern template +class LoopInfoBase; +#endif + class MachineLoopInfo : public MachineFunctionPass { LoopInfoBase LI; friend class LoopBase;