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
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 6e19fc8..fe61546 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -2998,7 +2998,7 @@
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 @@
// 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.