From d9cf6d49343f126b890470a9a89b31e524aac4ec Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Mon, 16 Oct 2017 22:47:26 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315950 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/ClangAttrEmitter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp index 6e19fc87d1..fe615468b1 100644 --- a/utils/TableGen/ClangAttrEmitter.cpp +++ b/utils/TableGen/ClangAttrEmitter.cpp @@ -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. -- 2.40.0