forked from OSchip/llvm-project
[NFC][tools] Return underlying strings directly instead of OS.str()
This avoids an unnecessary copy required by 'return OS.str()', allowing
instead for NRVO or implicit move. The .str() call (which flushes the
stream) is no longer required since 65b13610a5
,
which made raw_string_ostream unbuffered by default.
Differential Revision: https://reviews.llvm.org/D115374
This commit is contained in:
parent
5276002a89
commit
5336befe8c
|
@ -927,5 +927,5 @@ std::string TokenBuffer::dumpForTests() const {
|
|||
M.EndExpanded);
|
||||
}
|
||||
}
|
||||
return OS.str();
|
||||
return Dump;
|
||||
}
|
||||
|
|
|
@ -263,7 +263,7 @@ std::string syntax::Node::dumpTokens(const SourceManager &SM) const {
|
|||
OS << " ";
|
||||
}
|
||||
});
|
||||
return OS.str();
|
||||
return Storage;
|
||||
}
|
||||
|
||||
void syntax::Node::assertInvariants() const {
|
||||
|
|
|
@ -139,7 +139,7 @@ static std::string OptLLVM(const std::string &IR, CodeGenOpt::Level OLvl) {
|
|||
|
||||
Passes.run(*M);
|
||||
|
||||
return OS.str();
|
||||
return outString;
|
||||
}
|
||||
|
||||
// Takes a function and runs it on a set of inputs
|
||||
|
|
Loading…
Reference in New Issue