[llvm-commits] [llvm] r75790 - /llvm/trunk/include/llvm/System/Path.h

Dan Gohman gohman at apple.com
Wed Jul 15 09:33:39 PDT 2009


Author: djg
Date: Wed Jul 15 11:33:33 2009
New Revision: 75790

URL: http://llvm.org/viewvc/llvm-project?rev=75790&view=rev
Log:
Add a raw_ostream operator<< to sys::Path.

Modified:
    llvm/trunk/include/llvm/System/Path.h

Modified: llvm/trunk/include/llvm/System/Path.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/System/Path.h?rev=75790&r1=75789&r2=75790&view=diff

==============================================================================
--- llvm/trunk/include/llvm/System/Path.h (original)
+++ llvm/trunk/include/llvm/System/Path.h Wed Jul 15 11:33:33 2009
@@ -15,6 +15,7 @@
 #define LLVM_SYSTEM_PATH_H
 
 #include "llvm/System/TimeValue.h"
+#include "llvm/Support/raw_ostream.h"
 #include <set>
 #include <string>
 #include <vector>
@@ -714,6 +715,17 @@
   extern const char PathSeparator;
 }
 
+inline raw_ostream& operator<<(raw_ostream& strm, const sys::Path& aPath) {
+  strm << aPath.toString();
+  return strm;
+}
+
+inline raw_ostream& operator<<(raw_ostream& strm,
+                               const sys::PathWithStatus& aPath) {
+  strm << static_cast<const sys::Path&>(aPath);
+  return strm;
+}
+
 std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath);
 inline std::ostream& operator<<(std::ostream& strm,
                                 const sys::PathWithStatus& aPath) {





More information about the llvm-commits mailing list