aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-17 01:53:36 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-17 01:53:36 +0000
commitc39b80fdfc606f5df118288f4fc6b5e9c0b5ee41 (patch)
tree38820e71c811f62c6fc3185d69817dde82415911 /include
parent262541b074e6bbb83200ab3ce4f95ab8ab075013 (diff)
downloadexternal_llvm-c39b80fdfc606f5df118288f4fc6b5e9c0b5ee41.zip
external_llvm-c39b80fdfc606f5df118288f4fc6b5e9c0b5ee41.tar.gz
external_llvm-c39b80fdfc606f5df118288f4fc6b5e9c0b5ee41.tar.bz2
raw_ostream: Return '*this' explicitly (instead of implicitly via
write) to expose more alias information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/raw_ostream.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h
index 4db6737..3de31d6 100644
--- a/include/llvm/Support/raw_ostream.h
+++ b/include/llvm/Support/raw_ostream.h
@@ -119,11 +119,13 @@ public:
}
raw_ostream &operator<<(const char *Str) {
- return write(Str, strlen(Str));
+ write(Str, strlen(Str));
+ return *this;
}
raw_ostream &operator<<(const std::string& Str) {
- return write(Str.data(), Str.length());
+ write(Str.data(), Str.length());
+ return *this;
}
raw_ostream &operator<<(unsigned long N);
@@ -132,15 +134,18 @@ public:
raw_ostream &operator<<(long long N);
raw_ostream &operator<<(const void *P);
raw_ostream &operator<<(unsigned int N) {
- return this->operator<<(static_cast<unsigned long>(N));
+ this->operator<<(static_cast<unsigned long>(N));
+ return *this;
}
raw_ostream &operator<<(int N) {
- return this->operator<<(static_cast<long>(N));
+ this->operator<<(static_cast<long>(N));
+ return *this;
}
raw_ostream &operator<<(double N) {
- return this->operator<<(ftostr(N));
+ this->operator<<(ftostr(N));
+ return *this;
}
raw_ostream &write(unsigned char C);