From e69170a11079504e1b20ec79296925f295dc01c0 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Thu, 26 Jun 2014 22:52:05 +0000 Subject: Revert "Introduce a string_ostream string builder facilty" Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814 --- llvm/lib/TableGen/SetTheory.cpp | 11 ++++++----- llvm/lib/TableGen/TGParser.cpp | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'llvm/lib/TableGen') diff --git a/llvm/lib/TableGen/SetTheory.cpp b/llvm/lib/TableGen/SetTheory.cpp index 594d4d9a942..c99c2bab45a 100644 --- a/llvm/lib/TableGen/SetTheory.cpp +++ b/llvm/lib/TableGen/SetTheory.cpp @@ -209,12 +209,13 @@ struct SequenceOp : public SetTheory::Operator { break; else if (Step < 0 && From < To) break; - string_ostream Name; - Name << format(Format.c_str(), unsigned(From)); - Record *Rec = Records.getDef(Name.str()); + std::string Name; + raw_string_ostream OS(Name); + OS << format(Format.c_str(), unsigned(From)); + Record *Rec = Records.getDef(OS.str()); if (!Rec) - PrintFatalError(Loc, "No def named '" + Name.str() + "': " + - Expr->getAsString()); + PrintFatalError(Loc, "No def named '" + Name + "': " + + Expr->getAsString()); // Try to reevaluate Rec in case it is a set. if (const RecVec *Result = ST.expand(Rec)) Elts.insert(Result->begin(), Result->end()); diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index 76ef696c68c..0550692ebce 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -1307,7 +1307,8 @@ Init *TGParser::ParseSimpleValue(Record *CurRec, RecTy *ItemType, if (ItemType) { ListRecTy *ListType = dyn_cast(ItemType); if (!ListType) { - string_ostream ss; + std::string s; + raw_string_ostream ss(s); ss << "Type mismatch for list, expected list type, got " << ItemType->getAsString(); TokError(ss.str()); -- cgit v1.2.3