aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/ChainedIncludesSource.cpp2
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp1
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
-rw-r--r--clang/lib/Frontend/Rewrite/RewriteObjC.cpp9
4 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/Frontend/ChainedIncludesSource.cpp b/clang/lib/Frontend/ChainedIncludesSource.cpp
index c1a9f25..a7096e2 100644
--- a/clang/lib/Frontend/ChainedIncludesSource.cpp
+++ b/clang/lib/Frontend/ChainedIncludesSource.cpp
@@ -159,7 +159,7 @@ IntrusiveRefCntPtr<ExternalSemaSource> clang::createChainedIncludesSource(
std::string pchName = includes[i-1];
llvm::raw_string_ostream os(pchName);
os << ".pch" << i-1;
- serialBufNames.push_back(os.str());
+ serialBufNames.push_back(pchName);
IntrusiveRefCntPtr<ASTReader> Reader;
Reader = createASTReader(
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 5a27347..5f2a963 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -1383,7 +1383,6 @@ static bool compileModule(CompilerInstance &ImportingInstance,
std::string InferredModuleMapContent;
llvm::raw_string_ostream OS(InferredModuleMapContent);
Module->print(OS);
- OS.flush();
Result = compileModuleImpl(
ImportingInstance, ImportLoc, Module->getTopLevelModuleName(),
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 32628c5..de6776b 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -817,7 +817,6 @@ static bool RoundTrip(ParseFn Parse, GenerateFn Generate,
llvm::sys::printArg(OS, Arg, /*Quote=*/true);
OS << ' ';
}
- OS.flush();
return Buffer;
};
@@ -1186,7 +1185,6 @@ static bool ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args,
os << " ";
os << Args.getArgString(i);
}
- os.flush();
return Diags.getNumErrors() == NumErrorsBefore;
}
@@ -3735,7 +3733,7 @@ void CompilerInvocationBase::GenerateLangArgs(const LangOptions &Opts,
llvm::interleave(
Opts.OMPTargetTriples, OS,
[&OS](const llvm::Triple &T) { OS << T.str(); }, ",");
- GenerateArg(Consumer, OPT_fopenmp_targets_EQ, OS.str());
+ GenerateArg(Consumer, OPT_fopenmp_targets_EQ, Targets);
}
if (!Opts.OMPHostIRFile.empty())
diff --git a/clang/lib/Frontend/Rewrite/RewriteObjC.cpp b/clang/lib/Frontend/Rewrite/RewriteObjC.cpp
index fd5e8dc..f3afb3e 100644
--- a/clang/lib/Frontend/Rewrite/RewriteObjC.cpp
+++ b/clang/lib/Frontend/Rewrite/RewriteObjC.cpp
@@ -221,10 +221,9 @@ namespace {
return;
}
// Get the new text.
- std::string SStr;
- llvm::raw_string_ostream S(SStr);
+ std::string Str;
+ llvm::raw_string_ostream S(Str);
New->printPretty(S, nullptr, PrintingPolicy(LangOpts));
- const std::string &Str = S.str();
// If replacement succeeded or warning disabled return with no warning.
if (!Rewrite.ReplaceText(SrcRange.getBegin(), Size, Str)) {
@@ -1702,7 +1701,7 @@ Stmt *RewriteObjC::RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
llvm::raw_string_ostream syncExprBuf(syncExprBufS);
assert(syncExpr != nullptr && "Expected non-null Expr");
syncExpr->printPretty(syncExprBuf, nullptr, PrintingPolicy(LangOpts));
- syncBuf += syncExprBuf.str();
+ syncBuf += syncExprBufS;
syncBuf += ");";
buf += syncBuf;
@@ -2508,7 +2507,7 @@ Stmt *RewriteObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
std::string prettyBufS;
llvm::raw_string_ostream prettyBuf(prettyBufS);
Exp->getString()->printPretty(prettyBuf, nullptr, PrintingPolicy(LangOpts));
- Preamble += prettyBuf.str();
+ Preamble += prettyBufS;
Preamble += ",";
Preamble += utostr(Exp->getString()->getByteLength()) + "};\n";