From 06e8d835dde38ae25f995aac684bc0fab46dc514 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 31 Jul 2015 23:20:59 -0700 Subject: [PATCH] Provide ostream output for StringRef. --- include/llvm/StringRef.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/llvm/StringRef.h b/include/llvm/StringRef.h index fabda60d07..1ffe29fe60 100644 --- a/include/llvm/StringRef.h +++ b/include/llvm/StringRef.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -523,6 +524,11 @@ namespace llvm { return buffer.append(string.data(), string.size()); } + inline std::ostream &operator<<(std::ostream &os, StringRef string) { + os.write(string.data(), string.size()); + return os; + } + /// @} // StringRefs can be treated like a POD type.