diff --git a/polly/lib/Analysis/ScopDetectionDiagnostic.cpp b/polly/lib/Analysis/ScopDetectionDiagnostic.cpp index d2fbcf731985..14a6f074454f 100644 --- a/polly/lib/Analysis/ScopDetectionDiagnostic.cpp +++ b/polly/lib/Analysis/ScopDetectionDiagnostic.cpp @@ -89,7 +89,6 @@ template std::string operator+(Twine LHS, const T &RHS) { std::string Buf; raw_string_ostream fmt(Buf); fmt << RHS; - fmt.flush(); return LHS.concat(Buf).str(); } @@ -669,7 +668,7 @@ std::string ReportAlias::formatInvalidAlias(std::string Prefix, OS << Suffix; - return OS.str(); + return Message; } std::string ReportAlias::getRemarkName() const { return "Alias"; } diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 044d3573793f..56ffb990faf1 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -1818,11 +1818,9 @@ std::pair Scop::getEntryExitStr() const { raw_string_ostream EntryStr(EntryName); R.getEntry()->printAsOperand(EntryStr, false); - EntryStr.str(); if (R.getExit()) { R.getExit()->printAsOperand(ExitStr, false); - ExitStr.str(); } else ExitName = "FunctionExit"; diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 004fa64c82db..c58763603cfa 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -645,7 +645,7 @@ static std::string getInstName(Value *Val) { std::string Result; raw_string_ostream OS(Result); Val->printAsOperand(OS, false); - return OS.str(); + return Result; } void BlockGenerator::generateBeginStmtTrace(ScopStmt &Stmt, LoopToScevMapT <S, diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp index 63fb06a634cc..dfd63146edb5 100644 --- a/polly/lib/Exchange/JSONExporter.cpp +++ b/polly/lib/Exchange/JSONExporter.cpp @@ -116,12 +116,12 @@ static json::Array exportArrays(const Scop &S) { } for (; i < SAI->getNumberOfDimensions(); i++) { SAI->getDimensionSize(i)->print(RawStringOstream); - Sizes.push_back(RawStringOstream.str()); + Sizes.push_back(Buffer); Buffer.clear(); } Array["sizes"] = std::move(Sizes); SAI->getElementType()->print(RawStringOstream); - Array["type"] = RawStringOstream.str(); + Array["type"] = Buffer; Buffer.clear(); Arrays.push_back(std::move(Array)); } @@ -575,14 +575,14 @@ static bool areArraysEqual(ScopArrayInfo *SAI, const json::Object &Array) { for (unsigned i = 1; i < Array.getArray("sizes")->size(); i++) { SAI->getDimensionSize(i)->print(RawStringOstream); const json::Array &SizesArray = *Array.getArray("sizes"); - if (RawStringOstream.str() != SizesArray[i].getAsString().value()) + if (Buffer != SizesArray[i].getAsString().value()) return false; Buffer.clear(); } // Check if key 'type' differs from the current one or is not valid. SAI->getElementType()->print(RawStringOstream); - if (RawStringOstream.str() != Array.getString("type").value()) { + if (Buffer != Array.getString("type").value()) { errs() << "Array has not a valid type.\n"; return false; }