Replace usage of std::stringstream with raw_string_ostream

Typically we don't use the stringstream, so instead use
raw_string_stream.  Additionally, the dependent function
changed to use raw_ostream.

llvm-svn: 315950
This commit is contained in:
Erich Keane 2017-10-16 22:47:26 +00:00
parent ccd43758ad
commit df9e8aef6d
1 changed files with 3 additions and 2 deletions

View File

@ -2998,7 +2998,7 @@ static bool isArgVariadic(const Record &R, StringRef AttrName) {
return createArgument(R, AttrName)->isVariadic();
}
static void emitArgInfo(const Record &R, std::stringstream &OS) {
static void emitArgInfo(const Record &R, raw_ostream &OS) {
// This function will count the number of arguments specified for the
// attribute and emit the number of required arguments followed by the
// number of optional arguments.
@ -3471,7 +3471,8 @@ void EmitClangAttrParsedAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
// another mapping. At the same time, generate the AttrInfoMap object
// contents. Due to the reliance on generated code, use separate streams so
// that code will not be interleaved.
std::stringstream SS;
std::string Buffer;
raw_string_ostream SS {Buffer};
for (auto I = Attrs.begin(), E = Attrs.end(); I != E; ++I) {
// TODO: If the attribute's kind appears in the list of duplicates, that is
// because it is a target-specific attribute that appears multiple times.