diff options
author | Dan Gohman <gohman@apple.com> | 2009-12-14 19:32:31 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-12-14 19:32:31 +0000 |
commit | a4f8ecd85de38c14b11bbd0fc8cb9a427e9f3d75 (patch) | |
tree | 91a38d952e902d22a6ae052de8fb7dbc5774ffa1 /include/llvm/Support/raw_ostream.h | |
parent | a623f5a58dd7768b0cf4dbb61b1fffa8b4d07cca (diff) | |
download | external_llvm-a4f8ecd85de38c14b11bbd0fc8cb9a427e9f3d75.zip external_llvm-a4f8ecd85de38c14b11bbd0fc8cb9a427e9f3d75.tar.gz external_llvm-a4f8ecd85de38c14b11bbd0fc8cb9a427e9f3d75.tar.bz2 |
Micro-optimize these functions in the case where they are not inlined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/raw_ostream.h')
-rw-r--r-- | include/llvm/Support/raw_ostream.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h index a78e81f..2b3341d 100644 --- a/include/llvm/Support/raw_ostream.h +++ b/include/llvm/Support/raw_ostream.h @@ -186,14 +186,12 @@ public: // Inline fast path, particulary for constant strings where a sufficiently // smart compiler will simplify strlen. - this->operator<<(StringRef(Str)); - return *this; + return this->operator<<(StringRef(Str)); } raw_ostream &operator<<(const std::string &Str) { // Avoid the fast path, it would only increase code size for a marginal win. - write(Str.data(), Str.length()); - return *this; + return write(Str.data(), Str.length()); } raw_ostream &operator<<(unsigned long N); @@ -202,13 +200,11 @@ public: raw_ostream &operator<<(long long N); raw_ostream &operator<<(const void *P); raw_ostream &operator<<(unsigned int N) { - this->operator<<(static_cast<unsigned long>(N)); - return *this; + return this->operator<<(static_cast<unsigned long>(N)); } raw_ostream &operator<<(int N) { - this->operator<<(static_cast<long>(N)); - return *this; + return this->operator<<(static_cast<long>(N)); } raw_ostream &operator<<(double N); |