diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-03 00:10:29 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-03 00:10:29 +0000 |
commit | 1a55180238dbcf11113f610aea010447e51f595b (patch) | |
tree | b9769936054af70053271573496a228e18629946 | |
parent | 78236f8c8a0e6bd966afd7e461599336956f7772 (diff) |
Replace std::iostreams with raw_ostream in TableGen.
- Sorry, I can't help myself.
- No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74742 91177308-0d34-0410-b5e6-96231b3b80d8
36 files changed, 257 insertions, 266 deletions
diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp index 183c6912ba..f34feef0c2 100644 --- a/utils/TableGen/AsmWriterEmitter.cpp +++ b/utils/TableGen/AsmWriterEmitter.cpp @@ -19,6 +19,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" #include <algorithm> +#include <iostream> using namespace llvm; static bool isIdentChar(char C) { @@ -282,7 +283,7 @@ unsigned AsmWriterInst::MatchesAllButOneOp(const AsmWriterInst &Other)const{ } static void PrintCases(std::vector<std::pair<std::string, - AsmWriterOperand> > &OpsToPrint, std::ostream &O) { + AsmWriterOperand> > &OpsToPrint, raw_ostream &O) { O << " case " << OpsToPrint.back().first << ": "; AsmWriterOperand TheOp = OpsToPrint.back().second; OpsToPrint.pop_back(); @@ -304,7 +305,7 @@ static void PrintCases(std::vector<std::pair<std::string, /// EmitInstructions - Emit the last instruction in the vector and any other /// instructions that are suitably similar to it. static void EmitInstructions(std::vector<AsmWriterInst> &Insts, - std::ostream &O) { + raw_ostream &O) { AsmWriterInst FirstInst = Insts.back(); Insts.pop_back(); @@ -475,7 +476,7 @@ FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands, -void AsmWriterEmitter::run(std::ostream &O) { +void AsmWriterEmitter::run(raw_ostream &O) { EmitSourceFileHeader("Assembly Writer Source Fragment", O); CodeGenTarget Target; diff --git a/utils/TableGen/AsmWriterEmitter.h b/utils/TableGen/AsmWriterEmitter.h index 302722d6df..75e69964ef 100644 --- a/utils/TableGen/AsmWriterEmitter.h +++ b/utils/TableGen/AsmWriterEmitter.h @@ -32,7 +32,7 @@ namespace llvm { AsmWriterEmitter(RecordKeeper &R) : Records(R) {} // run - Output the asmwriter, returning true on failure. - void run(std::ostream &o); + void run(raw_ostream &o); private: AsmWriterInst *getAsmWriterInstByID(unsigned ID) const { diff --git a/utils/TableGen/CallingConvEmitter.cpp b/utils/TableGen/CallingConvEmitter.cpp index c1f8701433..a14be0b76f 100644 --- a/utils/TableGen/CallingConvEmitter.cpp +++ b/utils/TableGen/CallingConvEmitter.cpp @@ -17,7 +17,7 @@ #include "CodeGenTarget.h" using namespace llvm; -void CallingConvEmitter::run(std::ostream &O) { +void CallingConvEmitter::run(raw_ostream &O) { EmitSourceFileHeader("Calling Convention Implementation Fragment", O); std::vector<Record*> CCs = Records.getAllDerivedDefinitions("CallingConv"); @@ -39,7 +39,7 @@ void CallingConvEmitter::run(std::ostream &O) { } -void CallingConvEmitter::EmitCallingConv(Record *CC, std::ostream &O) { +void CallingConvEmitter::EmitCallingConv(Record *CC, raw_ostream &O) { ListInit *CCActions = CC->getValueAsListInit("Actions"); Counter = 0; @@ -60,7 +60,7 @@ void CallingConvEmitter::EmitCallingConv(Record *CC, std::ostream &O) { } void CallingConvEmitter::EmitAction(Record *Action, - unsigned Indent, std::ostream &O) { + unsigned Indent, raw_ostream &O) { std::string IndentStr = std::string(Indent, ' '); if (Action->isSubClassOf("CCPredicateAction")) { diff --git a/utils/TableGen/CallingConvEmitter.h b/utils/TableGen/CallingConvEmitter.h index ffd6a48c7a..7fc2507e88 100644 --- a/utils/TableGen/CallingConvEmitter.h +++ b/utils/TableGen/CallingConvEmitter.h @@ -27,11 +27,11 @@ namespace llvm { explicit CallingConvEmitter(RecordKeeper &R) : Records(R) {} // run - Output the asmwriter, returning true on failure. - void run(std::ostream &o); + void run(raw_ostream &o); private: - void EmitCallingConv(Record *CC, std::ostream &O); - void EmitAction(Record *Action, unsigned Indent, std::ostream &O); + void EmitCallingConv(Record *CC, raw_ostream &O); + void EmitAction(Record *Action, unsigned Indent, raw_ostream &O); unsigned Counter; }; } diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index a4a56983ca..c127afd770 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -15,7 +15,6 @@ #include "Record.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Compiler.h" -#include "llvm/Support/Streams.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/VectorExtras.h" @@ -27,7 +26,7 @@ using namespace llvm; // Warning Tables (.inc file) generation. //===----------------------------------------------------------------------===// -void ClangDiagsDefsEmitter::run(std::ostream &OS) { +void ClangDiagsDefsEmitter::run(raw_ostream &OS) { // Write the #if guard if (!Component.empty()) { std::string ComponentName = UppercaseString(Component); @@ -85,7 +84,7 @@ struct GroupInfo { unsigned IDNo; }; -void ClangDiagGroupsEmitter::run(std::ostream &OS) { +void ClangDiagGroupsEmitter::run(raw_ostream &OS) { // Invert the 1-[0/1] mapping of diags to group into a one to many mapping of // groups to diags in the group. std::map<std::string, GroupInfo> DiagsInGroup; diff --git a/utils/TableGen/ClangDiagnosticsEmitter.h b/utils/TableGen/ClangDiagnosticsEmitter.h index 58ea524d96..edd062a738 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.h +++ b/utils/TableGen/ClangDiagnosticsEmitter.h @@ -29,7 +29,7 @@ public: : Records(R), Component(component) {} // run - Output the .def file contents - void run(std::ostream &OS); + void run(raw_ostream &OS); }; class ClangDiagGroupsEmitter : public TableGenBackend { @@ -37,7 +37,7 @@ class ClangDiagGroupsEmitter : public TableGenBackend { public: explicit ClangDiagGroupsEmitter(RecordKeeper &R) : Records(R) {} - void run(std::ostream &OS); + void run(raw_ostream &OS); }; diff --git a/utils/TableGen/CodeEmitterGen.cpp b/utils/TableGen/CodeEmitterGen.cpp index 7b0a335b26..646602557b 100644 --- a/utils/TableGen/CodeEmitterGen.cpp +++ b/utils/TableGen/CodeEmitterGen.cpp @@ -75,7 +75,7 @@ int CodeEmitterGen::getVariableBit(const std::string &VarName, } -void CodeEmitterGen::run(std::ostream &o) { +void CodeEmitterGen::run(raw_ostream &o) { CodeGenTarget Target; std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction"); diff --git a/utils/TableGen/CodeEmitterGen.h b/utils/TableGen/CodeEmitterGen.h index cb272bd56d..f0b3229c04 100644 --- a/utils/TableGen/CodeEmitterGen.h +++ b/utils/TableGen/CodeEmitterGen.h @@ -30,10 +30,10 @@ public: CodeEmitterGen(RecordKeeper &R) : Records(R) {} // run - Output the code emitter - void run(std::ostream &o); + void run(raw_ostream &o); private: - void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace); - void emitGetValueBit(std::ostream &o, const std::string &Namespace); + void emitMachineOpEmitter(raw_ostream &o, const std::string &Namespace); + void emitGetValueBit(raw_ostream &o, const std::string &Namespace); void reverseBits(std::vector<Record*> &Insts); int getVariableBit(const std::string &VarName, BitsInit *BI, int bit); }; diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 6a7d305f78..2289ae789b 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -16,9 +16,9 @@ #include "Record.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Streams.h" #include <set> #include <algorithm> +#include <iostream> using namespace llvm; //===----------------------------------------------------------------------===// @@ -199,7 +199,7 @@ SDTypeConstraint::SDTypeConstraint(Record *R) { x.SDTCisEltOfVec_Info.OtherOperandNum = R->getValueAsInt("OtherOpNum"); } else { - cerr << "Unrecognized SDTypeConstraint '" << R->getName() << "'!\n"; + errs() << "Unrecognized SDTypeConstraint '" << R->getName() << "'!\n"; exit(1); } } @@ -213,9 +213,9 @@ TreePatternNode *SDTypeConstraint::getOperandNum(unsigned OpNo, "We only work with nodes with zero or one result so far!"); if (OpNo >= (NumResults + N->getNumChildren())) { - cerr << "Invalid operand number " << OpNo << " "; + errs() << "Invalid operand number " << OpNo << " "; N->dump(); - cerr << '\n'; + errs() << '\n'; exit(1); } @@ -413,8 +413,8 @@ SDNodeInfo::SDNodeInfo(Record *R) : Def(R) { } else if (PropList[i]->getName() == "SDNPMemOperand") { Properties |= 1 << SDNPMemOperand; } else { - cerr << "Unknown SD Node property '" << PropList[i]->getName() - << "' on node '" << R->getName() << "'!\n"; + errs() << "Unknown SD Node property '" << PropList[i]->getName() + << "' on node '" << R->getName() << "'!\n"; exit(1); } } @@ -516,7 +516,7 @@ bool TreePatternNode::UpdateNodeType(const std::vector<unsigned char> &ExtVTs, if (isLeaf()) { dump(); - cerr << " "; + errs() << " "; TP.error("Type inference contradiction found in node!"); } else { TP.error("Type inference contradiction found in node " + @@ -526,7 +526,7 @@ bool TreePatternNode::UpdateNodeType(const std::vector<unsigned char> &ExtVTs, } -void TreePatternNode::print(std::ostream &OS) const { +void TreePatternNode::print(raw_ostream &OS) const { if (isLeaf()) { OS << *getLeafValue(); } else { @@ -573,7 +573,7 @@ void TreePatternNode::print(std::ostream &OS) const { } void TreePatternNode::dump() const { - print(*cerr.stream()); + print(errs()); } /// isIsomorphicTo - Return true if this node is recursively @@ -1194,9 +1194,9 @@ TreePatternNode *TreePattern::ParseTreePattern(DagInit *Dag) { error("Constant int argument should not have a name!"); Children.push_back(Node); } else { - cerr << '"'; + errs() << '"'; Arg->dump(); - cerr << "\": "; + errs() << "\": "; error("Unknown leaf value for tree pattern!"); } } @@ -1246,7 +1246,7 @@ bool TreePattern::InferAllTypes() { return !HasUnresolvedTypes; } -void TreePattern::print(std::ostream &OS) const { +void TreePattern::print(raw_ostream &OS) const { OS << getRecord()->getName(); if (!Args.empty()) { OS << "(" << Args[0]; @@ -1268,7 +1268,7 @@ void TreePattern::print(std::ostream &OS) const { OS << "]\n"; } -void TreePattern::dump() const { print(*cerr.stream()); } +void TreePattern::dump() const { print(errs()); } //===----------------------------------------------------------------------===// // CodeGenDAGPatterns implementation @@ -1306,7 +1306,7 @@ CodeGenDAGPatterns::~CodeGenDAGPatterns() { Record *CodeGenDAGPatterns::getSDNodeNamed(const std::string &Name) const { Record *N = Records.getDef(Name); if (!N || !N->isSubClassOf("SDNode")) { - cerr << "Error getting SDNode '" << Name << "'!\n"; + errs() << "Error getting SDNode '" << Name << "'!\n"; exit(1); } return N; @@ -2012,15 +2012,15 @@ void CodeGenDAGPatterns::ParsePatterns() { Values.push_back(Tree->getArg(j)); TypedInit *TArg = dynamic_cast<TypedInit*>(Tree->getArg(j)); if (TArg == 0) { - cerr << "In dag: " << Tree->getAsString(); - cerr << " -- Untyped argument in pattern\n"; + errs() << "In dag: " << Tree->getAsString(); + errs() << " -- Untyped argument in pattern\n"; assert(0 && "Untyped argument in pattern"); } if (ListTy != 0) { ListTy = resolveTypes(ListTy, TArg->getType()); if (ListTy == 0) { - cerr << "In dag: " << Tree->getAsString(); - cerr << " -- Incompatible types in pattern arguments\n"; + errs() << "In dag: " << Tree->getAsString(); + errs() << " -- Incompatible types in pattern arguments\n"; assert(0 && "Incompatible types in pattern arguments"); } } @@ -2138,11 +2138,11 @@ static void CombineChildVariants(TreePatternNode *Orig, do { #ifndef NDEBUG if (DebugFlag && !Idxs.empty()) { - cerr << Orig->getOperator()->getName() << ": Idxs = [ "; + errs() << Orig->getOperator()->getName() << ": Idxs = [ "; for (unsigned i = 0; i < Idxs.size(); ++i) { - cerr << Idxs[i] << " "; + errs() << Idxs[i] << " "; } - cerr << "]\n"; + errs() << "]\n"; } #endif // Create the variant and add it to the output list. diff --git a/utils/TableGen/CodeGenDAGPatterns.h b/utils/TableGen/CodeGenDAGPatterns.h index 9ce14dcc7b..d398006812 100644 --- a/utils/TableGen/CodeGenDAGPatterns.h +++ b/utils/TableGen/CodeGenDAGPatterns.h @@ -236,7 +236,7 @@ public: /// marked isCommutative. bool isCommutativeIntrinsic(const CodeGenDAGPatterns &CDP) const; - void print(std::ostream &OS) const; + void print(raw_ostream &OS) const; void dump() const; public: // Higher level manipulation routines. @@ -370,7 +370,7 @@ public: /// pattern. void error(const std::string &Msg) const; - void print(std::ostream &OS) const; + void print(raw_ostream &OS) const; void dump() const; private: diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index e280a49bd3..c17cd0eef2 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -19,7 +19,6 @@ #include "Record.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/Streams.h" #include <algorithm> using namespace llvm; @@ -423,8 +422,8 @@ ComplexPattern::ComplexPattern(Record *R) { } else if (PropList[i]->getName() == "SDNPMemOperand") { Properties |= 1 << SDNPMemOperand; } else { - cerr << "Unsupported SD Node property '" << PropList[i]->getName() - << "' on ComplexPattern '" << R->getName() << "'!\n"; + errs() << "Unsupported SD Node property '" << PropList[i]->getName() + << "' on ComplexPattern '" << R->getName() << "'!\n"; exit(1); } @@ -435,8 +434,8 @@ ComplexPattern::ComplexPattern(Record *R) { if (PropList[i]->getName() == "CPAttrParentAsRoot") { Attributes |= 1 << CPAttrParentAsRoot; } else { - cerr << "Unsupported pattern attribute '" << PropList[i]->getName() - << "' on ComplexPattern '" << R->getName() << "'!\n"; + errs() << "Unsupported pattern attribute '" << PropList[i]->getName() + << "' on ComplexPattern '" << R->getName() << "'!\n"; exit(1); } } diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h index c7cc77ccd4..0ec9955814 100644 --- a/utils/TableGen/CodeGenTarget.h +++ b/utils/TableGen/CodeGenTarget.h @@ -17,10 +17,10 @@ #ifndef CODEGEN_TARGET_H #define CODEGEN_TARGET_H +#include "llvm/Support/raw_ostream.h" #include "CodeGenRegisters.h" #include "CodeGenInstruction.h" #include <algorithm> -#include <iosfwd> #include <map> namespace llvm { diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 0e2e61596f..bb26a1db3f 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -18,9 +18,9 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Streams.h" #include <algorithm> #include <deque> +#include <iostream> using namespace llvm; namespace { @@ -269,7 +269,7 @@ bool DisablePatternForFastISel(TreePatternNode *N, CodeGenDAGPatterns &CGP) { //===----------------------------------------------------------------------===// // Node Transformation emitter implementation. // -void DAGISelEmitter::EmitNodeTransforms(std::ostream &OS) { +void DAGISelEmitter::EmitNodeTransforms(raw_ostream &OS) { // Walk the pattern fragments, adding them to a map, which sorts them by // name. typedef std::map<std::string, CodeGenDAGPatterns::NodeXForm> NXsByNameTy; @@ -303,7 +303,7 @@ void DAGISelEmitter::EmitNodeTransforms(std::ostream &OS) { // Predicate emitter implementation. // -void DAGISelEmitter::EmitPredicateFunctions(std::ostream &OS) { +void DAGISelEmitter::EmitPredicateFunctions(raw_ostream &OS) { OS << "\n// Predicate functions.\n"; // Walk the pattern fragments, adding them to a map, which sorts them by @@ -751,7 +751,7 @@ public: } else { #ifndef NDEBUG Child->dump(); - cerr << " "; + errs() << " "; #endif assert(0 && "Unknown leaf type!"); } @@ -795,7 +795,7 @@ public: std::string Val = VariableMap[VarName]; bool ModifiedVal = false; if (Val.empty()) { - cerr << "Variable '" << VarName << " referenced but not defined " + errs() << "Variable '" << VarName << " referenced but not defined " << "and not caught earlier!\n"; abort(); } @@ -813,7 +813,7 @@ public: std::string TmpVar = "Tmp" + utostr(ResNo); switch (N->getTypeNum(0)) { default: - cerr << "Cannot handle " << getEnumName(N->getTypeNum(0)) + errs() << "Cannot handle " << getEnumName(N->getTypeNum(0)) << " type as an immediate constant. Aborting\n"; abort(); case MVT::i1: CastType = "bool"; break; @@ -1351,7 +1351,7 @@ public: } N->dump(); - cerr << "\n"; + errs() << "\n"; throw std::string("Unknown node in result pattern!"); } @@ -1537,7 +1537,7 @@ static bool EraseCodeLine(std::vector<std::pair<const PatternToMatch*, void DAGISelEmitter::EmitPatterns(std::vector<std::pair<const PatternToMatch*, std::vector<std::pair<unsigned, std::string> > > > &Patterns, unsigned Indent, - std::ostream &OS) { + raw_ostream &OS) { typedef std::pair<unsigned, std::string> CodeLine; typedef std::vector<CodeLine> CodeList; typedef std::vector<std::pair<const PatternToMatch*, CodeList> > PatternList; @@ -1652,7 +1652,7 @@ static std::string getLegalCName(std::string OpName) { return OpName; } -void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { +void DAGISelEmitter::EmitInstructionSelector(raw_ostream &OS) { const CodeGenTarget &Target = CGP.getTargetInfo(); // Get the namespace to insert instructions into. @@ -1684,10 +1684,10 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { &Pattern); } } else { - cerr << "Unrecognized opcode '"; + errs() << "Unrecognized opcode '"; Node->dump(); - cerr << "' on tree pattern '"; - cerr << Pattern.getDstPattern()->getOperator()->getName() << "'!\n"; + errs() << "' on tree pattern '"; + errs() << Pattern.getDstPattern()->getOperator()->getName() << "'!\n"; exit(1); } } @@ -1884,9 +1884,9 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { // If this pattern definitely matches, and if it isn't the last one, the // patterns after it CANNOT ever match. Error out. if (mightNotMatch == false && i != CodeForPatterns.size()-1) { - cerr << "Pattern '"; - CodeForPatterns[i].first->getSrcPattern()->print(*cerr.stream()); - cerr << "' is impossible to select!\n"; + errs() << "Pattern '"; + CodeForPatterns[i].first->getSrcPattern()->print(errs()); + errs() << "' is impossible to select!\n"; exit(1); } } @@ -2100,7 +2100,7 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { << "}\n\n"; } -void DAGISelEmitter::run(std::ostream &OS) { +void DAGISelEmitter::run(raw_ostream &OS) { EmitSourceFileHeader("DAG Instruction Selector for the " + CGP.getTargetInfo().getName() + " target", OS); diff --git a/utils/TableGen/DAGISelEmitter.h b/utils/TableGen/DAGISelEmitter.h index 1b9f8bad88..d5b889b055 100644 --- a/utils/TableGen/DAGISelEmitter.h +++ b/utils/TableGen/DAGISelEmitter.h @@ -30,12 +30,12 @@ public: explicit DAGISelEmitter(RecordKeeper &R) : Records(R), CGP(R) {} // run - Output the isel, returning true on failure. - void run(std::ostream &OS); + void run(raw_ostream &OS); private: - void EmitNodeTransforms(std::ostream &OS); - void EmitPredicateFunctions(std::ostream &OS); + void EmitNodeTransforms(raw_ostream &OS); + void EmitPredicateFunctions(raw_ostream &OS); void GenerateCodeForPattern(const PatternToMatch &Pattern, std::vector<std::pair<unsigned, std::string> > &GeneratedCode, @@ -46,9 +46,9 @@ private: unsigned &NumInputRootOps); void EmitPatterns(std::vector<std::pair<const PatternToMatch*, std::vector<std::pair<unsigned, std::string> > > > &Patterns, - unsigned Indent, std::ostream &OS); + unsigned Indent, raw_ostream &OS); - void EmitInstructionSelector(std::ostream &OS); + void EmitInstructionSelector(raw_ostream &OS); }; } // End llvm namespace diff --git a/utils/TableGen/FastISelEmitter.cpp b/utils/TableGen/FastISelEmitter.cpp index 8c60b08862..0a43f02d5a 100644 --- a/utils/TableGen/FastISelEmitter.cpp +++ b/utils/TableGen/FastISelEmitter.cpp @@ -20,7 +20,6 @@ #include "FastISelEmitter.h" #include "Record.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Streams.h" #include "llvm/ADT/VectorExtras.h" using namespace llvm; @@ -119,7 +118,7 @@ struct OperandsSignature { return true; } - void PrintParameters(std::ostream &OS) const { + void PrintParameters(raw_ostream &OS) const { for (unsigned i = 0, e = Operands.size(); i != e; ++i) { if (Operands[i] == "r") { OS << "unsigned Op" << i; @@ -136,7 +135,7 @@ struct OperandsSignature { } } - void PrintArguments(std::ostream &OS, + void PrintArguments(raw_ostream &OS, const std::vector<std::string>& PR) const { assert(PR.size() == Operands.size()); bool PrintedArg = false; @@ -163,7 +162,7 @@ struct OperandsSignature { } } - void PrintArguments(std::ostream &OS) const { + void PrintArguments(raw_ostream &OS) const { for (unsigned i = 0, e = Operands.size(); i != e; ++i) { if (Operands[i] == "r") { OS << "Op" << i; @@ -181,7 +180,7 @@ struct OperandsSignature { } - void PrintManglingSuffix(std::ostream &OS, + void PrintManglingSuffix(raw_ostream &OS, const std::vector<std::string>& PR) const { for (unsigned i = 0, e = Operands.size(); i != e; ++i) { if (PR[i] != "") @@ -195,7 +194,7 @@ struct OperandsSignature { } } - void PrintManglingSuffix(std::ostream &OS) const { + void PrintManglingSuffix(raw_ostream &OS) const { for (unsigned i = 0, e = Operands.size(); i != e; ++i) { OS << Operands[i]; } @@ -217,8 +216,8 @@ public: explicit FastISelMap(std::string InstNS); void CollectPatterns(CodeGenDAGPatterns &CGP); - void PrintClass(std::ostream &OS); - void PrintFunctionDefinitions(std::ostream &OS); + void PrintClass(raw_ostream &OS); + void PrintFunctionDefinitions(raw_ostream &OS); }; } @@ -368,7 +367,7 @@ void FastISelMap::CollectPatterns(CodeGenDAGPatterns &CGP) { } } -void FastISelMap::PrintFunctionDefinitions(std::ostream &OS) { +void FastISelMap::PrintFunctionDefinitions(raw_ostream &OS) { // Now emit code for all the patterns that we collected. for (OperandsOpcodeTypeRetPredMap::const_iterator OI = SimplePatterns.begin(), OE = SimplePatterns.end(); OI != OE; ++OI) { @@ -614,7 +613,7 @@ void FastISelMap::PrintFunctionDefinitions(std::ostream &OS) { } } -void FastISelEmitter::run(std::ostream &OS) { +void FastISelEmitter::run(raw_ostream &OS) { const CodeGenTarget &Target = CGP.getTargetInfo(); // Determine the target's namespace name. diff --git a/utils/TableGen/FastISelEmitter.h b/utils/TableGen/FastISelEmitter.h index 4743ca9bfa..ce4e77e6f8 100644 --- a/utils/TableGen/FastISelEmitter.h +++ b/utils/TableGen/FastISelEmitter.h @@ -31,7 +31,7 @@ public: explicit FastISelEmitter(RecordKeeper &R); // run - Output the isel, returning true on failure. - void run(std::ostream &OS); + void run(raw_ostream &OS); }; } // End llvm namespace diff --git a/utils/TableGen/InstrEnumEmitter.cpp b/utils/TableGen/InstrEnumEmitter.cpp i |