Teach raw_ostream to accept SmallString.

Saves adding .str() call to any raw_ostream << SmallString usage
and a small step towards making .str() consistent in the ADTs by
removing one of the SmallString::str() use cases, discussion at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141013/240026.html

I'll update the Phabricator patch http://reviews.llvm.org/D6372
for review of the Twine SmallString support, it's more complex
than this one.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231763 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Yaron Keren
2015-03-10 07:33:23 +00:00
parent 3a3665fd38
commit 1132d0cc5b
6 changed files with 17 additions and 12 deletions

View File

@@ -727,7 +727,7 @@ public:
OS.flush();
// Emit the string.
O.indent(6) << "AsmString = \"" << OutString.str() << "\";\n";
O.indent(6) << "AsmString = \"" << OutString << "\";\n";
O.indent(6) << "break;\n";
O.indent(4) << '}';

View File

@@ -188,7 +188,7 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
<< " children in Scope";
}
OS << '\n' << TmpBuf.str();
OS << '\n' << TmpBuf;
CurrentIdx += ChildSize;
}
@@ -342,7 +342,7 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
if (!OmitComments)
OS << "// ->" << CurrentIdx+ChildSize;
OS << '\n';
OS << TmpBuf.str();
OS << TmpBuf;
CurrentIdx += ChildSize;
}