From: Lang Hames Date: Wed, 21 Jul 2010 09:02:06 +0000 (+0000) Subject: Changed OStream templates to functions on raw_ostream, removed the unused "renderWarn... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=5a8ea65c5c72ee35c83f611a985d81efb8a4626e;hp=cf6ca031288332c4fb43a314a3c30df8deeb2ffb;p=oota-llvm.git Changed OStream templates to functions on raw_ostream, removed the unused "renderWarnings" function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109003 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/RenderMachineFunction.cpp b/lib/CodeGen/RenderMachineFunction.cpp index 0f5f67dd0d8..9bcbfb40d35 100644 --- a/lib/CodeGen/RenderMachineFunction.cpp +++ b/lib/CodeGen/RenderMachineFunction.cpp @@ -499,8 +499,7 @@ namespace llvm { // ---------- MachineFunctionRenderer implementation ---------- - template - void RenderMachineFunction::Spacer::print(OStream &os) const { + void RenderMachineFunction::Spacer::print(raw_ostream &os) const { if (!prettyHTML) return; for (unsigned i = 0; i < ns; ++i) { @@ -512,8 +511,7 @@ namespace llvm { return Spacer(ns); } - template - OStream& operator<<(OStream &os, const RenderMachineFunction::Spacer &s) { + raw_ostream& operator<<(raw_ostream &os, const RenderMachineFunction::Spacer &s) { s.print(os); return os; } @@ -583,8 +581,7 @@ namespace llvm { } /// \brief Render a machine instruction. - template - void RenderMachineFunction::renderMachineInstr(OStream &os, + void RenderMachineFunction::renderMachineInstr(raw_ostream &os, const MachineInstr *mi) const { std::string s; raw_string_ostream oss(s); @@ -593,9 +590,9 @@ namespace llvm { os << escapeChars(oss.str()); } - template + template void RenderMachineFunction::renderVertical(const Spacer &indent, - OStream &os, + raw_ostream &os, const T &t) const { if (ro.fancyVerticals()) { os << indent << " void RenderMachineFunction::insertCSS(const Spacer &indent, - OStream &os) const { + raw_ostream &os) const { os << indent << "\n"; } - template void RenderMachineFunction::renderFunctionSummary( - const Spacer &indent, OStream &os, + const Spacer &indent, raw_ostream &os, const char * const renderContextStr) const { os << indent << "

Function: " << mf->getFunction()->getName() << "

\n" @@ -657,10 +652,9 @@ namespace llvm { } - template void RenderMachineFunction::renderPressureTableLegend( const Spacer &indent, - OStream &os) const { + raw_ostream &os) const { os << indent << "

Rendering Pressure Legend:

\n" << indent << "\n" << indent + s(2) << "\n" @@ -685,9 +679,9 @@ namespace llvm { << indent << "
\n"; } - template + template void RenderMachineFunction::renderCellsWithRLE( - const Spacer &indent, OStream &os, + const Spacer &indent, raw_ostream &os, const std::pair &rleAccumulator, const std::map &cellTypeStrs) const { @@ -706,9 +700,8 @@ namespace llvm { } - template void RenderMachineFunction::renderCodeTablePlusPI(const Spacer &indent, - OStream &os) const { + raw_ostream &os) const { std::map lsStrs; lsStrs[Dead] = "l-n"; @@ -854,14 +847,8 @@ namespace llvm { renderPressureTableLegend(indent, os); } - template - void RenderMachineFunction::renderWarnings(const Spacer &indent, - OStream &os) const { - } - - template void RenderMachineFunction::renderFunctionPage( - OStream &os, + raw_ostream &os, const char * const renderContextStr) const { os << "\n" << s(2) << "\n" diff --git a/lib/CodeGen/RenderMachineFunction.h b/lib/CodeGen/RenderMachineFunction.h index 090b03ecd65..4d22b34d558 100644 --- a/lib/CodeGen/RenderMachineFunction.h +++ b/lib/CodeGen/RenderMachineFunction.h @@ -31,6 +31,7 @@ namespace llvm { class TargetRegisterClass; class TargetRegisterInfo; class VirtRegMap; + class raw_ostream; /// \brief Provide extra information about the physical and virtual registers /// in the function being compiled. @@ -225,8 +226,7 @@ namespace llvm { private: class Spacer; - template - friend OStream& operator<<(OStream &os, const Spacer &s); + friend raw_ostream& operator<<(raw_ostream &os, const Spacer &s); std::string fqn; @@ -256,7 +256,7 @@ namespace llvm { public: explicit Spacer(unsigned numSpaces) : ns(numSpaces) {} Spacer operator+(const Spacer &o) const { return Spacer(ns + o.ns); } - template void print(OStream &os) const; + void print(raw_ostream &os) const; private: unsigned ns; }; @@ -267,57 +267,44 @@ namespace llvm { std::string escapeChars(Iterator sBegin, Iterator sEnd) const; /// \brief Render a machine instruction. - template - void renderMachineInstr(OStream &os, + void renderMachineInstr(raw_ostream &os, const MachineInstr *mi) const; /// \brief Render vertical text. - template + template void renderVertical(const Spacer &indent, - OStream &os, + raw_ostream &os, const T &t) const; /// \brief Insert CSS layout info. - template void insertCSS(const Spacer &indent, - OStream &os) const; + raw_ostream &os) const; /// \brief Render a brief summary of the function (including rendering /// context). - template void renderFunctionSummary(const Spacer &indent, - OStream &os, + raw_ostream &os, const char * const renderContextStr) const; /// \brief Render a legend for the pressure table. - template void renderPressureTableLegend(const Spacer &indent, - OStream &os) const; + raw_ostream &os) const; /// \brief Render a consecutive set of HTML cells of the same class using /// the colspan attribute for run-length encoding. - template + template void renderCellsWithRLE( - const Spacer &indent, OStream &os, + const Spacer &indent, raw_ostream &os, const std::pair &rleAccumulator, const std::map &cellTypeStrs) const; /// \brief Render code listing, potentially with register pressure /// and live intervals shown alongside. - template void renderCodeTablePlusPI(const Spacer &indent, - OStream &os) const; - - /// \brief Render warnings about the machine function, or weird rendering - /// parameter combinations (e.g. rendering specified live intervals - /// over more than one machine function). - template - void renderWarnings(const Spacer &indent, - OStream &os) const; + raw_ostream &os) const; /// \brief Render the HTML page representing the MachineFunction. - template - void renderFunctionPage(OStream &os, + void renderFunctionPage(raw_ostream &os, const char * const renderContextStr) const; std::string escapeChars(const std::string &s) const;