Index: llvm/trunk/lib/Target/Hexagon/RDFGraph.h =================================================================== --- llvm/trunk/lib/Target/Hexagon/RDFGraph.h +++ llvm/trunk/lib/Target/Hexagon/RDFGraph.h @@ -924,10 +924,6 @@ return MM; } - template struct Print; - template - raw_ostream &operator<< (raw_ostream &OS, const Print &P); - template struct Print { Print(const T &x, const DataFlowGraph &g) : Obj(x), G(g) {} @@ -942,6 +938,29 @@ : Print>(x, g) {} }; + raw_ostream &operator<<(raw_ostream &OS, const Print &P); + raw_ostream &operator<<(raw_ostream &OS, const Print &P); + raw_ostream &operator<<(raw_ostream &OS, const Print> &P); + raw_ostream &operator<<(raw_ostream &OS, const Print> &P); + raw_ostream &operator<<(raw_ostream &OS, + const Print> &P); + raw_ostream &operator<<(raw_ostream &OS, const Print> &P); + raw_ostream &operator<<(raw_ostream &OS, const Print &P); + raw_ostream &operator<<(raw_ostream &OS, const Print &P); + raw_ostream &operator<<(raw_ostream &OS, const Print> &P); + raw_ostream &operator<<(raw_ostream &OS, + const Print> &P); + raw_ostream &operator<<(raw_ostream &OS, + const Print> &P); + raw_ostream &operator<<(raw_ostream &OS, + const Print> &P); + raw_ostream &operator<<(raw_ostream &OS, + const Print> &P); + raw_ostream &operator<<(raw_ostream &OS, const Print &P); + raw_ostream &operator<<(raw_ostream &OS, const Print &P); + raw_ostream &operator<<(raw_ostream &OS, + const Print &P); + } // end namespace rdf } // end namespace llvm Index: llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp =================================================================== --- llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp +++ llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp @@ -54,7 +54,6 @@ return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print &P) { auto &TRI = P.G.getTRI(); if (P.Obj.Reg > 0 && P.Obj.Reg < TRI.getNumRegs()) @@ -65,7 +64,6 @@ return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print &P) { auto NA = P.G.addr(P.Obj); uint16_t Attrs = NA.Addr->getAttrs(); @@ -115,7 +113,6 @@ OS << '!'; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print> &P) { printRefHeader(OS, P.Obj, P.G); OS << '('; @@ -133,7 +130,6 @@ return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print> &P) { printRefHeader(OS, P.Obj, P.G); OS << '('; @@ -145,7 +141,6 @@ return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print> &P) { printRefHeader(OS, P.Obj, P.G); @@ -161,7 +156,6 @@ return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print> &P) { switch (P.Obj.Addr->getKind()) { case NodeAttrs::Def: @@ -177,7 +171,6 @@ return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print &P) { unsigned N = P.Obj.size(); for (auto I : P.Obj) { @@ -188,7 +181,6 @@ return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print &P) { unsigned N = P.Obj.size(); for (auto I : P.Obj) { @@ -223,16 +215,13 @@ } // end anonymous namespace -template<> raw_ostream &operator<< (raw_ostream &OS, const Print> &P) { OS << Print(P.Obj.Id, P.G) << ": phi [" << PrintListV(P.Obj.Addr->members(P.G), P.G) << ']'; return OS; } -template<> -raw_ostream &operator<< (raw_ostream &OS, - const Print> &P) { +raw_ostream &operator<<(raw_ostream &OS, const Print> &P) { const MachineInstr &MI = *P.Obj.Addr->getCode(); unsigned Opc = MI.getOpcode(); OS << Print(P.Obj.Id, P.G) << ": " << P.G.getTII().getName(Opc); @@ -257,7 +246,6 @@ return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print> &P) { switch (P.Obj.Addr->getKind()) { @@ -274,7 +262,6 @@ return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print> &P) { MachineBasicBlock *BB = P.Obj.Addr->getCode(); @@ -308,9 +295,7 @@ return OS; } -template<> -raw_ostream &operator<< (raw_ostream &OS, - const Print> &P) { +raw_ostream &operator<<(raw_ostream &OS, const Print> &P) { OS << "DFG dump:[\n" << Print(P.Obj.Id, P.G) << ": Function: " << P.Obj.Addr->getCode()->getName() << '\n'; for (auto I : P.Obj.Addr->members(P.G)) @@ -319,7 +304,6 @@ return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print &P) { OS << '{'; for (auto I : P.Obj) @@ -328,13 +312,11 @@ return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print &P) { P.Obj.print(OS); return OS; } -template<> raw_ostream &operator<< (raw_ostream &OS, const Print &P) { for (auto I = P.Obj.top(), E = P.Obj.bottom(); I != E; ) { Index: llvm/trunk/lib/Target/Hexagon/RDFLiveness.h =================================================================== --- llvm/trunk/lib/Target/Hexagon/RDFLiveness.h +++ llvm/trunk/lib/Target/Hexagon/RDFLiveness.h @@ -142,6 +142,8 @@ unsigned Nest, unsigned MaxNest); }; + raw_ostream &operator<<(raw_ostream &OS, const Print &P); + } // end namespace rdf } // end namespace llvm Index: llvm/trunk/lib/Target/Hexagon/RDFLiveness.cpp =================================================================== --- llvm/trunk/lib/Target/Hexagon/RDFLiveness.cpp +++ llvm/trunk/lib/Target/Hexagon/RDFLiveness.cpp @@ -57,7 +57,6 @@ namespace llvm { namespace rdf { - template<> raw_ostream &operator<< (raw_ostream &OS, const Print &P) { OS << '{'; for (auto &I : P.Obj) {