[llvm-commits] [llvm] r67070 - /llvm/trunk/include/llvm/Support/raw_ostream.h

Daniel Dunbar daniel at zuster.org
Mon Mar 16 18:53:36 PDT 2009


Author: ddunbar
Date: Mon Mar 16 20:53:36 2009
New Revision: 67070

URL: http://llvm.org/viewvc/llvm-project?rev=67070&view=rev
Log:
raw_ostream: Return '*this' explicitly (instead of implicitly via
write) to expose more alias information.

Modified:
    llvm/trunk/include/llvm/Support/raw_ostream.h

Modified: llvm/trunk/include/llvm/Support/raw_ostream.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=67070&r1=67069&r2=67070&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/raw_ostream.h (original)
+++ llvm/trunk/include/llvm/Support/raw_ostream.h Mon Mar 16 20:53:36 2009
@@ -119,11 +119,13 @@
   }
 
   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 @@
   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);





More information about the llvm-commits mailing list