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

Chris Lattner clattner at apple.com
Wed Jul 15 09:39:59 PDT 2009


On Jul 15, 2009, at 9:33 AM, Dan Gohman wrote:

> 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.

Is this really worthwhile?  This tightly couples sys::Path and  
raw_ostream.  Why can't the client just use toString?  The API for  
sys::Path is already significantly broken in a lot of ways, I'd like  
for it to not expand in scope.

-Chris

>
> 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) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list