[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-11-05 Thread Jeff Cohen


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.42 -> 1.43
---
Log message:

Unbreak VC++ build.

---
Diffs of the changes:  (+1 -1)

 Path.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.42 
llvm/include/llvm/System/Path.h:1.43
--- llvm/include/llvm/System/Path.h:1.42Wed Aug 23 15:34:57 2006
+++ llvm/include/llvm/System/Path.h Sun Nov  5 13:31:28 2006
@@ -47,7 +47,7 @@
group(999), isDir(false) { }
 
 TimeValue getTimestamp() const { return modTime; }
-size_t getSize() const { return fileSize; }
+uint64_t getSize() const { return fileSize; }
 uint32_t getMode() const { return mode; }
 uint32_t getUser() const { return user; }
 uint32_t getGroup() const { return group; }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-03-29 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.43 -> 1.44
---
Log message:

For PR789: http://llvm.org/PR789 :
* Add a method: bool isAbsolute() const, which determines if the path name
  is absolute or not.
* Implement caching of file status information in the Path object. Allow it
  to be updated forcefully or lazily re-fetched from the cached value.


---
Diffs of the changes:  (+14 -4)

 Path.h |   18 ++
 1 files changed, 14 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.43 
llvm/include/llvm/System/Path.h:1.44
--- llvm/include/llvm/System/Path.h:1.43Sun Nov  5 13:31:28 2006
+++ llvm/include/llvm/System/Path.h Thu Mar 29 11:43:20 2007
@@ -123,7 +123,7 @@
   /// Find the path to a library using its short name. Use the system
   /// dependent library paths to locate the library.
   /// @brief Find a library.
-  static Path  FindLibrary(std::string& short_name);
+  static Path FindLibrary(std::string& short_name);
 
   /// Construct a path to the default LLVM configuration directory. The
   /// implementation must ensure that this is a well-known (same on many
@@ -162,14 +162,14 @@
   /// provided so that they can be used to indicate null or error results 
in
   /// other lib/System functionality.
   /// @brief Construct an empty (and invalid) path.
-  Path() : path() {}
+  Path() : path(), status(0) {}
 
   /// This constructor will accept a std::string as a path. No checking is
   /// done on this path to determine if it is valid. To determine validity
   /// of the path, use the isValid method. 
   /// @param p The path to assign.
   /// @brief Construct a Path from a string.
-  explicit Path(const std::string& p) : path(p) {}
+  explicit Path(const std::string& p) : path(p), status(0) {}
 
 /// @}
 /// @name Operators
@@ -265,6 +265,11 @@
   /// @brief Determines if the path references the root directory.
   bool isRootDirectory() const;
 
+  /// This function determines if the path name is absolute, as opposed to
+  /// relative. 
+  /// @breif Determine if the path is absolute.
+  bool isAbsolute() const;
+
   /// This function opens the file associated with the path name provided 
by
   /// the Path object and reads its magic number. If the magic number at 
the
   /// start of the file matches \p magic, true is returned. In all other
@@ -352,7 +357,11 @@
   /// of the file system.  This returns false on success, or true on error
   /// and fills in the specified error string if specified.
   /// @brief Get file status.
-  bool getFileStatus(FileStatus &Status, std::string *Error = 0) const;
+  bool getFileStatus(
+  FileStatus &Status,   ///< The resulting file status
+  bool forceUpdate = false, ///< Force an update from the file system
+  std::string *Error = 0///< Optional place to return an error msg.
+  ) const;
 
 /// @}
 /// @name Path Mutators
@@ -511,6 +520,7 @@
 /// @{
 private:
   mutable std::string path;   ///< Storage for the path name.
+  mutable FileStatus *status; ///< Status information.
 
 /// @}
   };



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-03-29 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.44 -> 1.45
---
Log message:

Don't forget to delete the FileStatus structure on destruction of Path.


---
Diffs of the changes:  (+1 -0)

 Path.h |1 +
 1 files changed, 1 insertion(+)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.44 
llvm/include/llvm/System/Path.h:1.45
--- llvm/include/llvm/System/Path.h:1.44Thu Mar 29 11:43:20 2007
+++ llvm/include/llvm/System/Path.h Thu Mar 29 11:50:49 2007
@@ -163,6 +163,7 @@
   /// other lib/System functionality.
   /// @brief Construct an empty (and invalid) path.
   Path() : path(), status(0) {}
+  ~Path() { delete status; }
 
   /// This constructor will accept a std::string as a path. No checking is
   /// done on this path to determine if it is valid. To determine validity



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-03-29 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.45 -> 1.46
---
Log message:

Add a uniqueID field to the FileStatus structure for Paths. This will map
to the inode number on Unix and something far less unique on Windows. The
windows case needs to be improved.


---
Diffs of the changes:  (+3 -1)

 Path.h |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.45 
llvm/include/llvm/System/Path.h:1.46
--- llvm/include/llvm/System/Path.h:1.45Thu Mar 29 11:50:49 2007
+++ llvm/include/llvm/System/Path.h Thu Mar 29 12:00:31 2007
@@ -40,17 +40,19 @@
 uint32_tmode;   ///< Mode of the file, if applicable
 uint32_tuser;   ///< User ID of owner, if applicable
 uint32_tgroup;  ///< Group ID of owner, if applicable
+uint64_tuniqueID;   ///< A number to uniquely ID this file
 boolisDir  : 1; ///< True if this is a directory.
 boolisFile : 1; ///< True if this is a file.
 
 FileStatus() : fileSize(0), modTime(0,0), mode(0777), user(999),
-   group(999), isDir(false) { }
+   group(999), uniqueID(0), isDir(false), isFile(false) { }
 
 TimeValue getTimestamp() const { return modTime; }
 uint64_t getSize() const { return fileSize; }
 uint32_t getMode() const { return mode; }
 uint32_t getUser() const { return user; }
 uint32_t getGroup() const { return group; }
+uint32_t getUniqueID() const { return uniqueID; }
   };
 
   /// This class provides an abstraction for the path to a file or directory



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-03-29 Thread Jeff Cohen


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.46 -> 1.47
---
Log message:

uniqueID is a uint64_t (caught by VC++)

---
Diffs of the changes:  (+1 -1)

 Path.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.46 
llvm/include/llvm/System/Path.h:1.47
--- llvm/include/llvm/System/Path.h:1.46Thu Mar 29 12:00:31 2007
+++ llvm/include/llvm/System/Path.h Thu Mar 29 12:28:31 2007
@@ -52,7 +52,7 @@
 uint32_t getMode() const { return mode; }
 uint32_t getUser() const { return user; }
 uint32_t getGroup() const { return group; }
-uint32_t getUniqueID() const { return uniqueID; }
+uint64_t getUniqueID() const { return uniqueID; }
   };
 
   /// This class provides an abstraction for the path to a file or directory



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-03-29 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.47 -> 1.48
---
Log message:

For PR789: http://llvm.org/PR789 :
Make the sys::Path::getFileStatus function more efficient by having it
return a pointer to the FileStatus structure rather than copy it. Adjust
uses of the function accordingly. Also, fix some memory issues in sys::Path.


---
Diffs of the changes:  (+15 -9)

 Path.h |   24 +++-
 1 files changed, 15 insertions(+), 9 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.47 
llvm/include/llvm/System/Path.h:1.48
--- llvm/include/llvm/System/Path.h:1.47Thu Mar 29 12:28:31 2007
+++ llvm/include/llvm/System/Path.h Thu Mar 29 14:05:44 2007
@@ -166,6 +166,7 @@
   /// @brief Construct an empty (and invalid) path.
   Path() : path(), status(0) {}
   ~Path() { delete status; }
+  Path(const Path &that) : path(that.path), status(0) {}
 
   /// This constructor will accept a std::string as a path. No checking is
   /// done on this path to determine if it is valid. To determine validity
@@ -183,6 +184,9 @@
   /// @brief Assignment Operator
   Path &operator=(const Path &that) {
 path = that.path;
+if (status)
+  delete status;
+status = 0;
 return *this;
   }
 
@@ -223,9 +227,11 @@
   /// @brief Determine if a path is syntactically valid or not.
   bool isValid() const;
 
-  /// This function determines if the contents of the path name are
-  /// empty. That is, the path has a zero length. This does NOT determine 
if
-  /// if the file is empty. Use the getSize method for that.
+  /// This function determines if the contents of the path name are empty. 
+  /// That is, the path name has a zero length. This does NOT determine if
+  /// if the file is empty. To get the length of the file itself, Use the 
+  /// getFileStatus() method and then the getSize() on the returned
+  /// FileStatus object
   /// @returns true iff the path is empty.
   /// @brief Determines if the path name is empty (invalid).
   bool isEmpty() const { return path.empty(); }
@@ -357,13 +363,13 @@
 
   /// This function returns status information about the file. The type of
   /// path (file or directory) is updated to reflect the actual contents
-  /// of the file system.  This returns false on success, or true on error
-  /// and fills in the specified error string if specified.
+  /// of the file system.
+  /// @returns 0 on failure, with Error explaining why (if non-zero)
+  /// @returns a pointer to a FileStatus structure on success.
   /// @brief Get file status.
-  bool getFileStatus(
-  FileStatus &Status,   ///< The resulting file status
-  bool forceUpdate = false, ///< Force an update from the file system
-  std::string *Error = 0///< Optional place to return an error msg.
+  const FileStatus *getFileStatus(
+bool forceUpdate = false, ///< Force an update from the file system
+std::string *Error = 0///< Optional place to return an error msg.
   ) const;
 
 /// @}



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-04-03 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.48 -> 1.49
---
Log message:

For PR1302: http://llvm.org/PR1302 :
Make the FileType enumerators more readable and add COFF, ELF and Mach-O.


---
Diffs of the changes:  (+7 -4)

 Path.h |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.48 
llvm/include/llvm/System/Path.h:1.49
--- llvm/include/llvm/System/Path.h:1.48Thu Mar 29 14:05:44 2007
+++ llvm/include/llvm/System/Path.h Wed Apr  4 01:29:49 2007
@@ -536,10 +536,13 @@
 
   /// This enumeration delineates the kinds of files that LLVM knows about.
   enum LLVMFileType {
-UnknownFileType = 0,///< Unrecognized file
-BytecodeFileType = 1,   ///< Uncompressed bytecode file
-CompressedBytecodeFileType = 2, ///< Compressed bytecode file
-ArchiveFileType = 3 ///< ar style archive file
+Unknown_FileType = 0,///< Unrecognized file
+Bytecode_FileType = 1,   ///< Uncompressed bytecode file
+CompressedBytecode_FileType = 2, ///< Compressed bytecode file
+Archive_FileType = 3,///< ar style archive file
+ELF_FileType = 4,///< Native ELF object file or lib
+Mach_O_FileType = 5, ///< Native Mach-O object file or lib
+COFF_FileType = 6///< COFF object file or lib
   };
 
   /// This utility function allows any memory block to be examined in order



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-04-08 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.50 -> 1.51
---
Log message:

Implement the output inserter for PathWithStatus


---
Diffs of the changes:  (+5 -2)

 Path.h |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.50 
llvm/include/llvm/System/Path.h:1.51
--- llvm/include/llvm/System/Path.h:1.50Sat Apr  7 13:52:17 2007
+++ llvm/include/llvm/System/Path.h Sun Apr  8 15:05:10 2007
@@ -617,9 +617,12 @@
   bool CopyFile(const Path& Dest, const Path& Src, std::string* ErrMsg);
 }
 
-
 std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath);
-std::ostream& operator<<(std::ostream& strm, const sys::PathWithStatus& aPath);
+inline std::ostream& operator<<(std::ostream& strm, 
+const sys::PathWithStatus& aPath) {
+  strm << static_cast(aPath);
+  return strm;
+}
 
 }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-04-10 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.51 -> 1.52
---
Log message:

Teach sys::Path how to recognize different kinds of object files for ELF
and Mach-O systems. Additionally, correct the Mach-O logic code to look at
byte 12 not byte 15. Hopefully this fixes the llvm-ld warning on Darwin.


---
Diffs of the changes:  (+18 -7)

 Path.h |   25 ++---
 1 files changed, 18 insertions(+), 7 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.51 
llvm/include/llvm/System/Path.h:1.52
--- llvm/include/llvm/System/Path.h:1.51Sun Apr  8 15:05:10 2007
+++ llvm/include/llvm/System/Path.h Tue Apr 10 21:02:09 2007
@@ -597,13 +597,24 @@
 
   /// This enumeration delineates the kinds of files that LLVM knows about.
   enum LLVMFileType {
-Unknown_FileType = 0,///< Unrecognized file
-Bytecode_FileType = 1,   ///< Uncompressed bytecode file
-CompressedBytecode_FileType = 2, ///< Compressed bytecode file
-Archive_FileType = 3,///< ar style archive file
-ELF_FileType = 4,///< Native ELF object file or lib
-Mach_O_FileType = 5, ///< Native Mach-O object file or lib
-COFF_FileType = 6///< COFF object file or lib
+Unknown_FileType = 0,  ///< Unrecognized file
+Bytecode_FileType, ///< Uncompressed bytecode file
+CompressedBytecode_FileType,   ///< Compressed bytecode file
+Archive_FileType,  ///< ar style archive file
+ELF_Relocatable_FileType,  ///< ELF Relocatable object file
+ELF_Executable_FileType,   ///< ELF Executable image
+ELF_SharedObject_FileType, ///< ELF dynamically linked shared lib
+ELF_Core_FileType, ///< ELF core image
+Mach_O_Object_FileType,///< Mach-O Object file
+Mach_O_Executable_FileType,///< Mach-O Executable
+Mach_O_FixedVirtualMemorySharedLib_FileType, ///< Mach-O Shared Lib, FVM
+Mach_O_Core_FileType,  ///< Mach-O Core File
+Mach_O_PreloadExectuable_FileType, ///< Mach-O Preloaded Executable
+Mach_O_DynamicallyLinkedSharedLib_FileType, ///< Mach-O dynlinked shared 
lib
+Mach_O_DynamicLinker_FileType, ///< The Mach-O dynamic linker
+Mach_O_Bundle_FileType,///< Mach-O Bundle file
+Mach_O_DynamicallyLinkedSharedLibStub_FileType, ///< Mach-O Shared lib stub
+COFF_FileType  ///< COFF object file or lib
   };
 
   /// This utility function allows any memory block to be examined in order



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-06-08 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.28 -> 1.29
---
Log message:

For PR804: http://llvm.org/PR804 :
Change the file size field of StatusInfo to be uint64_t instead of size_t
so that we know it is always 64 bits. This prevents some overflow on
systems where size_t is 32 bits when it ought to be 64.


---
Diffs of the changes:  (+1 -1)

 Path.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.28 
llvm/include/llvm/System/Path.h:1.29
--- llvm/include/llvm/System/Path.h:1.28Wed Feb 22 10:23:43 2006
+++ llvm/include/llvm/System/Path.h Thu Jun  8 12:00:08 2006
@@ -67,7 +67,7 @@
   struct StatusInfo {
 StatusInfo() : fileSize(0), modTime(0,0), mode(0777), user(999),
group(999), isDir(false) { }
-size_t  fileSize;   ///< Size of the file in bytes
+uint64_tfileSize;   ///< Size of the file in bytes
 TimeValue   modTime;///< Time of file's modification
 uint32_tmode;   ///< Mode of the file, if applicable
 uint32_tuser;   ///< User ID of owner, if applicable



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-07-07 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.29 -> 1.30
---
Log message:

#include  not 


---
Diffs of the changes:  (+2 -5)

 Path.h |7 ++-
 1 files changed, 2 insertions(+), 5 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.29 
llvm/include/llvm/System/Path.h:1.30
--- llvm/include/llvm/System/Path.h:1.29Thu Jun  8 12:00:08 2006
+++ llvm/include/llvm/System/Path.h Fri Jul  7 13:10:59 2006
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 namespace llvm {
 namespace sys {
@@ -567,10 +567,7 @@
   void CopyFile(const Path& Dest, const Path& Src);
 }
 
-inline std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath) {
-  strm << aPath.toString();
-  return strm;
-}
+std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath);
 
 }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-07-28 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.31 -> 1.32
---
Log message:

Change Path::getStatusInfo to return a boolean and error string on an error
instead of throwing an exception.  This reduces the amount of code that is
exposed to exceptions (e.g. FileUtilities), though it is clearly only one step
along the way.


---
Diffs of the changes:  (+44 -56)

 Path.h |  100 -
 1 files changed, 44 insertions(+), 56 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.31 
llvm/include/llvm/System/Path.h:1.32
--- llvm/include/llvm/System/Path.h:1.31Wed Jul 26 11:55:39 2006
+++ llvm/include/llvm/System/Path.h Fri Jul 28 17:03:44 2006
@@ -24,6 +24,35 @@
 namespace llvm {
 namespace sys {
 
+  /// This structure provides basic file system information about a file. It
+  /// is patterned after the stat(2) Unix operating system call but made
+  /// platform independent and eliminates many of the unix-specific fields.
+  /// However, to support llvm-ar, the mode, user, and group fields are
+  /// retained. These pertain to unix security and may not have a meaningful
+  /// value on non-Unix platforms. However, the fileSize and modTime fields
+  /// should always be applicable on all platforms.  The structure is
+  /// filled in by the Path::getFileStatus method.
+  /// @brief File status structure
+  class FileStatus {
+  public:
+uint64_tfileSize;   ///< Size of the file in bytes
+TimeValue   modTime;///< Time of file's modification
+uint32_tmode;   ///< Mode of the file, if applicable
+uint32_tuser;   ///< User ID of owner, if applicable
+uint32_tgroup;  ///< Group ID of owner, if applicable
+boolisDir  : 1; ///< True if this is a directory.
+boolisFile : 1; ///< True if this is a file.
+
+FileStatus() : fileSize(0), modTime(0,0), mode(0777), user(999),
+   group(999), isDir(false) { }
+
+TimeValue getTimestamp() const { return modTime; }
+size_t getSize() const { return fileSize; }
+uint32_t getMode() const { return mode; }
+uint32_t getUser() const { return user; }
+uint32_t getGroup() const { return group; }
+  };
+
   /// This class provides an abstraction for the path to a file or directory
   /// in the operating system's filesystem and provides various basic 
operations
   /// on it.  Note that this class only represents the name of a path to a file
@@ -53,30 +82,6 @@
   /// @since 1.4
   /// @brief An abstraction for operating system paths.
   class Path {
-/// @name Types
-/// @{
-public:
-  /// This structure provides basic file system information about a file. 
It
-  /// is patterned after the stat(2) Unix operating system call but made
-  /// platform independent and eliminates many of the unix-specific fields.
-  /// However, to support llvm-ar, the mode, user, and group fields are
-  /// retained. These pertain to unix security and may not have a 
meaningful
-  /// value on non-Unix platforms. However, the fileSize and modTime fields
-  /// should always be applicabe on all platforms.  The structure is
-  /// filled in by the getStatusInfo method.
-  /// @brief File status structure
-  struct StatusInfo {
-StatusInfo() : fileSize(0), modTime(0,0), mode(0777), user(999),
-   group(999), isDir(false) { }
-uint64_tfileSize;   ///< Size of the file in bytes
-TimeValue   modTime;///< Time of file's modification
-uint32_tmode;   ///< Mode of the file, if applicable
-uint32_tuser;   ///< User ID of owner, if applicable
-uint32_tgroup;  ///< Group ID of owner, if applicable
-boolisDir;  ///< True if this is a directory.
-  };
-
-/// @}
 /// @name Constructors
 /// @{
 public:
@@ -175,7 +180,7 @@
   /// Makes a copy of \p that to \p this.
   /// @returns \p this
   /// @brief Assignment Operator
-  Path & operator = ( const Path & that ) {
+  Path &operator=(const Path &that) {
 path = that.path;
 return *this;
   }
@@ -183,15 +188,15 @@
   /// Compares \p this Path with \p that Path for equality.
   /// @returns true if \p this and \p that refer to the same thing.
   /// @brief Equality Operator
-  bool operator == (const Path& that) const {
-return 0 == path.compare(that.path) ;
+  bool operator==(const Path &that) const {
+return 0 == path.compare(that.path);
   }
 
   /// Compares \p this Path with \p that Path for inequality.
   /// @returns true if \p this and \p that refer to different things.
   /// @brief Inequality Operator
-  bool operator !=( const Path & that ) const {
-return 0 != path.compare( that.path );
+  bool operator!=(const Path &that) co

[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-07-28 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.32 -> 1.33
---
Log message:

Modify Path::eraseFromDisk to not throw an exception.


---
Diffs of the changes:  (+4 -6)

 Path.h |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.32 
llvm/include/llvm/System/Path.h:1.33
--- llvm/include/llvm/System/Path.h:1.32Fri Jul 28 17:03:44 2006
+++ llvm/include/llvm/System/Path.h Fri Jul 28 17:29:50 2006
@@ -522,17 +522,15 @@
   /// \p destroy_contents parameter is ignored.
   /// @param destroy_contents Indicates whether the contents of a destroyed
   /// directory should also be destroyed (recursively).
-  /// @returns true if the file/directory was destroyed, false if the path
-  /// refers to something that is neither a file nor a directory.
-  /// @throws std::string if there is an error.
+  /// @returns false if the file/directory was destroyed, true on error.
   /// @brief Removes the file or directory from the filesystem.
-  bool eraseFromDisk(bool destroy_contents = false) const;
-
+  bool eraseFromDisk(bool destroy_contents = false,
+ std::string *Err = 0) const;
 /// @}
 /// @name Data
 /// @{
 private:
-mutable std::string path;   ///< Storage for the path name.
+  mutable std::string path;   ///< Storage for the path name.
 
 /// @}
   };



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-07-28 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.33 -> 1.34
---
Log message:

Modify setStatusInfoOnDisk to not throw an exception.


---
Diffs of the changes:  (+3 -2)

 Path.h |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.33 
llvm/include/llvm/System/Path.h:1.34
--- llvm/include/llvm/System/Path.h:1.33Fri Jul 28 17:29:50 2006
+++ llvm/include/llvm/System/Path.h Fri Jul 28 17:36:17 2006
@@ -461,9 +461,10 @@
   /// This method allows the last modified time stamp and permission bits
   /// to be set on the disk object referenced by the Path.
   /// @throws std::string if an error occurs.
-  /// @returns true
+  /// @returns true on error.
   /// @brief Set the status information.
-  bool setStatusInfoOnDisk(const FileStatus &SI) const;
+  bool setStatusInfoOnDisk(const FileStatus &SI,
+   std::string *ErrStr = 0) const;
 
   /// This method attempts to create a directory in the file system with 
the
   /// same name as the Path object. The \p create_parents parameter 
controls



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-08-01 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.34 -> 1.35
---
Log message:

Remove some now-dead methods.  Use getFileStatus instead.


---
Diffs of the changes:  (+0 -22)

 Path.h |   22 --
 1 files changed, 22 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.34 
llvm/include/llvm/System/Path.h:1.35
--- llvm/include/llvm/System/Path.h:1.34Fri Jul 28 17:36:17 2006
+++ llvm/include/llvm/System/Path.h Tue Aug  1 13:16:02 2006
@@ -259,28 +259,6 @@
 /// @name Disk Accessors
 /// @{
 public:
-  /// This function determines if the object referenced by this path is
-  /// a file or not. This function accesses the underlying file system to
-  /// determine the type of entity referenced by the path.
-  /// @returns true if this path name references a file.
-  /// @brief Determines if the path name references a file.
-  bool isFile() const;
-
-  /// This function determines if the object referenced by this path is a
-  /// directory or not. This function accesses the underlying file system 
to
-  /// determine the type of entity referenced by the path.
-  /// @returns true if the path name references a directory
-  /// @brief Determines if the path name references a directory.
-  bool isDirectory() const;
-
-  /// This function determines if the path refers to a hidden file. The
-  /// notion of hidden files is defined by  the underlying system. The
-  /// system may not support hidden files in which case this function 
always
-  /// returns false on such systems. Hidden files have the "hidden"
-  /// attribute set on Win32. On Unix, hidden files start with a period.
-  /// @brief Determines if the path name references a hidden file.
-  bool isHidden() const;
-
   /// This function determines if the path name in this object references
   /// the root (top level directory) of the file system. The details of 
what
   /// is considered the "root" may vary from system to system so this 
method



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-08-22 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.35 -> 1.36
---
Log message:

Make the sys::Path::GetTemporaryDirectory method not throw exceptions and
adjust users of it to compensate.


---
Diffs of the changes:  (+4 -3)

 Path.h |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.35 
llvm/include/llvm/System/Path.h:1.36
--- llvm/include/llvm/System/Path.h:1.35Tue Aug  1 13:16:02 2006
+++ llvm/include/llvm/System/Path.h Tue Aug 22 14:01:30 2006
@@ -97,10 +97,11 @@
   /// a "standard" place for the operating system. The directory is
   /// guaranteed to be created on exit from this function. If the directory
   /// cannot be created, the function will throw an exception.
-  /// @throws std::string indicating why the directory could not be 
created.
+  /// @returns an invalid path (empty) on error
+  /// @param ErrMsg Optional place for an error message if an error occurs
   /// @brief Constrct a path to an new, unique, existing temporary
   /// directory.
-  static Path GetTemporaryDirectory();
+  static Path GetTemporaryDirectory(std::string* ErrMsg);
 
   /// Construct a vector of sys::Path that contains the "standard" system
   /// library paths suitable for linking into programs. This function 
*must*
@@ -171,7 +172,7 @@
   /// @throws std::string if \p unverified_path is not legal.
   /// @param unverified_path The path to verify and assign.
   /// @brief Construct a Path from a string.
-  explicit Path(const std::string& unverified_path);
+  explicit Path(const std::string& p) : path(p) {}
 
 /// @}
 /// @name Operators



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-08-22 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.36 -> 1.37
---
Log message:

For PR797: http://llvm.org/PR797 :
Change the Path::make*OnDisk methods exception free and adjust their usage.


---
Diffs of the changes:  (+4 -4)

 Path.h |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.36 
llvm/include/llvm/System/Path.h:1.37
--- llvm/include/llvm/System/Path.h:1.36Tue Aug 22 14:01:30 2006
+++ llvm/include/llvm/System/Path.h Tue Aug 22 18:27:22 2006
@@ -101,7 +101,7 @@
   /// @param ErrMsg Optional place for an error message if an error occurs
   /// @brief Constrct a path to an new, unique, existing temporary
   /// directory.
-  static Path GetTemporaryDirectory(std::string* ErrMsg);
+  static Path GetTemporaryDirectory(std::string* ErrMsg = 0);
 
   /// Construct a vector of sys::Path that contains the "standard" system
   /// library paths suitable for linking into programs. This function 
*must*
@@ -424,18 +424,18 @@
   /// This method attempts to make the file referenced by the Path object
   /// available for reading so that the canRead() method will return true.
   /// @brief Make the file readable;
-  void makeReadableOnDisk();
+  bool makeReadableOnDisk(std::string* ErrMsg);
 
   /// This method attempts to make the file referenced by the Path object
   /// available for writing so that the canWrite() method will return true.
   /// @brief Make the file writable;
-  void makeWriteableOnDisk();
+  bool makeWriteableOnDisk(std::string* ErrMsg);
 
   /// This method attempts to make the file referenced by the Path object
   /// available for execution so that the canExecute() method will return
   /// true.
   /// @brief Make the file readable;
-  void makeExecutableOnDisk();
+  bool makeExecutableOnDisk(std::string* ErrMsg);
 
   /// This method allows the last modified time stamp and permission bits
   /// to be set on the disk object referenced by the Path.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-08-22 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.37 -> 1.38
---
Log message:

For PR797: http://llvm.org/PR797 :
Remove exceptions from the Path::create*OnDisk methods. Update their users
to handle error messages via arguments and result codes.


---
Diffs of the changes:  (+21 -19)

 Path.h |   40 +---
 1 files changed, 21 insertions(+), 19 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.37 
llvm/include/llvm/System/Path.h:1.38
--- llvm/include/llvm/System/Path.h:1.37Tue Aug 22 18:27:22 2006
+++ llvm/include/llvm/System/Path.h Tue Aug 22 19:39:34 2006
@@ -424,18 +424,18 @@
   /// This method attempts to make the file referenced by the Path object
   /// available for reading so that the canRead() method will return true.
   /// @brief Make the file readable;
-  bool makeReadableOnDisk(std::string* ErrMsg);
+  bool makeReadableOnDisk(std::string* ErrMsg = 0);
 
   /// This method attempts to make the file referenced by the Path object
   /// available for writing so that the canWrite() method will return true.
   /// @brief Make the file writable;
-  bool makeWriteableOnDisk(std::string* ErrMsg);
+  bool makeWriteableOnDisk(std::string* ErrMsg = 0);
 
   /// This method attempts to make the file referenced by the Path object
   /// available for execution so that the canExecute() method will return
   /// true.
   /// @brief Make the file readable;
-  bool makeExecutableOnDisk(std::string* ErrMsg);
+  bool makeExecutableOnDisk(std::string* ErrMsg = 0);
 
   /// This method allows the last modified time stamp and permission bits
   /// to be set on the disk object referenced by the Path.
@@ -452,23 +452,25 @@
   /// intermediate directories, as needed. If \p create_parents is false,
   /// then only the final directory component of the Path name will be
   /// created. The created directory will have no entries.
-  /// @returns false if the Path does not reference a directory, true
-  /// otherwise.
-  /// @param create_parents Determines whether non-existent directory
-  /// components other than the last one (the "parents") are created or 
not.
-  /// @throws std::string if an error occurs.
+  /// @returns true if the directory could not be created, false otherwise
   /// @brief Create the directory this Path refers to.
-  bool createDirectoryOnDisk( bool create_parents = false );
+  bool createDirectoryOnDisk( 
+bool create_parents = false, ///<  Determines whether non-existent 
+   ///< directory components other than the last one (the "parents") 
+   ///< are created or not.
+std::string* ErrMsg = 0 ///< Optional place to put error messages.
+  );
 
   /// This method attempts to create a file in the file system with the 
same
   /// name as the Path object. The intermediate directories must all exist
   /// at the time this method is called. Use createDirectoriesOnDisk to
   /// accomplish that. The created file will be empty upon return from this
   /// function.
-  /// @returns false if the Path does not reference a file, true otherwise.
-  /// @throws std::string if an error occurs.
+  /// @returns true if the file could not be created, false otherwise.
   /// @brief Create the file this Path refers to.
-  bool createFileOnDisk();
+  bool createFileOnDisk(
+std::string* ErrMsg = 0 ///< Optional place to put error messages.
+  );
 
   /// This is like createFile except that it creates a temporary file. A
   /// unique temporary file name is generated based on the contents of
@@ -476,14 +478,14 @@
   /// file is created.  Note that this will both change the Path object
   /// *and* create the corresponding file. This function will ensure that
   /// the newly generated temporary file name is unique in the file system.
-  /// @param reuse_current When set to true, this parameter indicates that
-  /// if the current file name does not exist then it will be used without
-  /// modification.
-  /// @returns true if successful, false if the file couldn't be created.
-  /// @throws std::string if there is a hard error creating the temp file
-  /// name.
+  /// @returns true if the file couldn't be created, false otherwise. 
   /// @brief Create a unique temporary file
-  bool createTemporaryFileOnDisk(bool reuse_current = false);
+  bool createTemporaryFileOnDisk(
+bool reuse_current = false, ///< When set to true, this parameter 
+  ///< indicates that if the current file name does not exist then 
+  ///< it will be used without modification.
+std::string* ErrMsg = 0 ///< Optional place to put error messages
+  );
 
   /// This method renames the file referenced by \p this as \p newName

[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-08-22 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.38 -> 1.39
---
Log message:

For PR797: http://llvm.org/PR797 :
Remove exception throwing from Path::getDirectoryContents and its users.


---
Diffs of the changes:  (+5 -3)

 Path.h |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.38 
llvm/include/llvm/System/Path.h:1.39
--- llvm/include/llvm/System/Path.h:1.38Tue Aug 22 19:39:34 2006
+++ llvm/include/llvm/System/Path.h Wed Aug 23 01:56:27 2006
@@ -343,10 +343,12 @@
 
   /// This function builds a list of paths that are the names of the
   /// files and directories in a directory.
-  /// @returns false if \p this is not a directory, true otherwise
-  /// @throws std::string if the directory cannot be searched
+  /// @returns true if an error occurs, true otherwise
   /// @brief Build a list of directory's contents.
-  bool getDirectoryContents(std::set &paths) const;
+  bool getDirectoryContents(
+std::set &paths, ///< The resulting list of file & directory 
names
+std::string* ErrMsg///< Optional place to return an error message.
+  ) const;
 
   /// This function returns status information about the file. The type of
   /// path (file or directory) is updated to reflect the actual contents



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-08-23 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.39 -> 1.40
---
Log message:

For PR797: http://llvm.org/PR797 :
Eliminate exception throwing from Path::renamePathOnDisk and adjust its 
users correspondingly.


---
Diffs of the changes:  (+2 -3)

 Path.h |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.39 
llvm/include/llvm/System/Path.h:1.40
--- llvm/include/llvm/System/Path.h:1.39Wed Aug 23 01:56:27 2006
+++ llvm/include/llvm/System/Path.h Wed Aug 23 02:30:48 2006
@@ -492,10 +492,9 @@
   /// This method renames the file referenced by \p this as \p newName. The
   /// file referenced by \p this must exist. The file referenced by
   /// \p newName does not need to exist.
-  /// @returns true
-  /// @throws std::string if there is an file system error.
+  /// @returns true on error, false otherwise
   /// @brief Rename one file as another.
-  bool renamePathOnDisk(const Path& newName);
+  bool renamePathOnDisk(const Path& newName, std::string* ErrMsg);
 
   /// This method attempts to destroy the file or directory named by the
   /// last component of the Path. If the Path refers to a directory and the



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-08-23 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.40 -> 1.41
---
Log message:


---
Diffs of the changes:  (+4 -7)

 Path.h |   11 ---
 1 files changed, 4 insertions(+), 7 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.40 
llvm/include/llvm/System/Path.h:1.41
--- llvm/include/llvm/System/Path.h:1.40Wed Aug 23 02:30:48 2006
+++ llvm/include/llvm/System/Path.h Wed Aug 23 12:43:20 2006
@@ -164,13 +164,10 @@
   /// @brief Construct an empty (and invalid) path.
   Path() : path() {}
 
-  /// This constructor will accept a std::string as a path but it verifies
-  /// that the path string has a legal syntax for the operating system on
-  /// which it is running. This allows a path to be taken in from outside
-  /// the program. However, if the path is not valid, the Path object will
-  /// be set to an empty string and an exception will be thrown.
-  /// @throws std::string if \p unverified_path is not legal.
-  /// @param unverified_path The path to verify and assign.
+  /// This constructor will accept a std::string as a path. No checking is
+  /// done on this path to determine if it is valid. To determine validity
+  /// of the path, use the isValid method. 
+  /// @param p The path to assign.
   /// @brief Construct a Path from a string.
   explicit Path(const std::string& p) : path(p) {}
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2006-08-23 Thread Reid Spencer


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.41 -> 1.42
---
Log message:

For PR797: http://llvm.org/PR797 :
Final removal of exceptions from lib/System and adjustment of users to
accommodate.


---
Diffs of the changes:  (+3 -3)

 Path.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.41 
llvm/include/llvm/System/Path.h:1.42
--- llvm/include/llvm/System/Path.h:1.41Wed Aug 23 12:43:20 2006
+++ llvm/include/llvm/System/Path.h Wed Aug 23 15:34:57 2006
@@ -414,7 +414,7 @@
   /// already unique.
   /// @throws std::string if an unrecoverable error occurs.
   /// @brief Make the current path name unique in the file system.
-  void makeUnique( bool reuse_current = true );
+  bool makeUnique( bool reuse_current /*= true*/, std::string* ErrMsg );
 
 /// @}
 /// @name Disk Mutators
@@ -529,9 +529,9 @@
 
   /// This function can be used to copy the file specified by Src to the
   /// file specified by Dest. If an error occurs, Dest is removed.
-  /// @throws std::string if an error opening or writing the files occurs.
+  /// @returns true if an error occurs, false otherwise
   /// @brief Copy one file to another.
-  void CopyFile(const Path& Dest, const Path& Src);
+  bool CopyFile(const Path& Dest, const Path& Src, std::string* ErrMsg);
 }
 
 std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-04-28 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.52 -> 1.53
---
Log message:

new method for creating a path, which does not create a temporary string.


---
Diffs of the changes:  (+8 -0)

 Path.h |8 
 1 files changed, 8 insertions(+)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.52 
llvm/include/llvm/System/Path.h:1.53
--- llvm/include/llvm/System/Path.h:1.52Tue Apr 10 21:02:09 2007
+++ llvm/include/llvm/System/Path.h Sun Apr 29 01:16:32 2007
@@ -174,6 +174,14 @@
   /// @brief Construct a Path from a string.
   explicit Path(const std::string& p) : path(p) {}
 
+  /// This constructor will accept a character range as a path.  No 
checking
+  /// is done on this path to determine if it is valid.  To determine
+  /// validity of the path, use the isValid method. 
+  /// @param p The path to assign.
+  /// @brief Construct a Path from a string.
+  explicit Path(const char *StrStart, unsigned StrLen)
+: path(StrStart, StrStart+StrLen) {}
+  
 /// @}
 /// @name Operators
 /// @{



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-04-29 Thread Jeff Cohen


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.53 -> 1.54
---
Log message:

Fix MemoryBuffer breakage correctly.

---
Diffs of the changes:  (+8 -0)

 Path.h |8 
 1 files changed, 8 insertions(+)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.53 
llvm/include/llvm/System/Path.h:1.54
--- llvm/include/llvm/System/Path.h:1.53Sun Apr 29 01:16:32 2007
+++ llvm/include/llvm/System/Path.h Sun Apr 29 09:43:30 2007
@@ -559,6 +559,14 @@
   explicit PathWithStatus(const std::string& p) 
 : Path(p), status(), fsIsValid(false) {}
 
+  /// This constructor will accept a character range as a path.  No 
checking
+  /// is done on this path to determine if it is valid.  To determine
+  /// validity of the path, use the isValid method. 
+  /// @param p The path to assign.
+  /// @brief Construct a Path from a string.
+  explicit PathWithStatus(const char *StrStart, unsigned StrLen)
+: Path(StrStart, StrLen), status(), fsIsValid(false) {}
+
   /// Makes a copy of \p that to \p this.
   /// @returns \p this
   /// @brief Assignment Operator



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-04-29 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.54 -> 1.55
---
Log message:

add missing ctor


---
Diffs of the changes:  (+6 -2)

 Path.h |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.54 
llvm/include/llvm/System/Path.h:1.55
--- llvm/include/llvm/System/Path.h:1.54Sun Apr 29 09:43:30 2007
+++ llvm/include/llvm/System/Path.h Sun Apr 29 12:40:50 2007
@@ -177,8 +177,6 @@
   /// This constructor will accept a character range as a path.  No 
checking
   /// is done on this path to determine if it is valid.  To determine
   /// validity of the path, use the isValid method. 
-  /// @param p The path to assign.
-  /// @brief Construct a Path from a string.
   explicit Path(const char *StrStart, unsigned StrLen)
 : path(StrStart, StrStart+StrLen) {}
   
@@ -551,6 +549,12 @@
   PathWithStatus(const Path &other) 
 : Path(other), status(), fsIsValid(false) {}
 
+  /// This constructor will accept a character range as a path.  No 
checking
+  /// is done on this path to determine if it is valid.  To determine
+  /// validity of the path, use the isValid method. 
+  PathWithStatus(const char *StrStart, unsigned StrLen)
+: Path(StrStart, StrLen), fsIsValid(false) {}
+
   /// This constructor will accept a std::string as a path. No checking is
   /// done on this path to determine if it is valid. To determine validity
   /// of the path, use the isValid method. 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-04-29 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.55 -> 1.56
---
Log message:

Jeff's fix was fine


---
Diffs of the changes:  (+2 -6)

 Path.h |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.55 
llvm/include/llvm/System/Path.h:1.56
--- llvm/include/llvm/System/Path.h:1.55Sun Apr 29 12:40:50 2007
+++ llvm/include/llvm/System/Path.h Sun Apr 29 12:44:10 2007
@@ -177,6 +177,8 @@
   /// This constructor will accept a character range as a path.  No 
checking
   /// is done on this path to determine if it is valid.  To determine
   /// validity of the path, use the isValid method. 
+  /// @param p The path to assign.
+  /// @brief Construct a Path from a string.
   explicit Path(const char *StrStart, unsigned StrLen)
 : path(StrStart, StrStart+StrLen) {}
   
@@ -549,12 +551,6 @@
   PathWithStatus(const Path &other) 
 : Path(other), status(), fsIsValid(false) {}
 
-  /// This constructor will accept a character range as a path.  No 
checking
-  /// is done on this path to determine if it is valid.  To determine
-  /// validity of the path, use the isValid method. 
-  PathWithStatus(const char *StrStart, unsigned StrLen)
-: Path(StrStart, StrLen), fsIsValid(false) {}
-
   /// This constructor will accept a std::string as a path. No checking is
   /// done on this path to determine if it is valid. To determine validity
   /// of the path, use the isValid method. 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-05-03 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.56 -> 1.57
---
Log message:

remove extraneous type qualifiers


---
Diffs of the changes:  (+1 -1)

 Path.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.56 
llvm/include/llvm/System/Path.h:1.57
--- llvm/include/llvm/System/Path.h:1.56Sun Apr 29 12:44:10 2007
+++ llvm/include/llvm/System/Path.h Thu May  3 13:14:56 2007
@@ -264,7 +264,7 @@
   /// Obtain a 'C' string for the path name.
   /// @returns a 'C' string containing the path name.
   /// @brief Returns the path as a C string.
-  const char *const c_str() const { return path.c_str(); }
+  const char *c_str() const { return path.c_str(); }
 
 /// @}
 /// @name Disk Accessors



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-05-05 Thread Chris Lattner


Changes in directory llvm/include/llvm/System:

Path.h updated: 1.57 -> 1.58
---
Log message:

add support for identifying bitcode files


---
Diffs of the changes:  (+8 -0)

 Path.h |8 
 1 files changed, 8 insertions(+)


Index: llvm/include/llvm/System/Path.h
diff -u llvm/include/llvm/System/Path.h:1.57 
llvm/include/llvm/System/Path.h:1.58
--- llvm/include/llvm/System/Path.h:1.57Thu May  3 13:14:56 2007
+++ llvm/include/llvm/System/Path.h Sun May  6 00:30:10 2007
@@ -313,6 +313,13 @@
   /// @brief Determine if the path references a bytecode file.
   bool isBytecodeFile() const;
 
+  /// This function determines if the path name in the object references an
+  /// LLVM Bitcode file by looking at its magic number.
+  /// @returns true if the file starts with the magic number for LLVM
+  /// bitcode files.
+  /// @brief Determine if the path references a bitcode file.
+  bool isBitcodeFile() const;
+  
   /// This function determines if the path name in the object references a
   /// native Dynamic Library (shared library, shared object) by looking at
   /// the file's magic number. The Path object must reference a file, not a
@@ -615,6 +622,7 @@
   enum LLVMFileType {
 Unknown_FileType = 0,  ///< Unrecognized file
 Bytecode_FileType, ///< Uncompressed bytecode file
+Bitcode_FileType,  ///< Bitcode file
 CompressedBytecode_FileType,   ///< Compressed bytecode file
 Archive_FileType,  ///< ar style archive file
 ELF_Relocatable_FileType,  ///< ELF Relocatable object file



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-03-29 Thread Chris Lattner
>
> For PR789: http://llvm.org/PR789 :
> * Add a method: bool isAbsolute() const, which determines if the  
> path name
>   is absolute or not.
> * Implement caching of file status information in the Path object.  
> Allow it
>   to be updated forcefully or lazily re-fetched from the cached value.

Nice.  Instead of new'ing the status object separately from the Path  
object, why not embed it by-value?

-Chris



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-03-29 Thread Reid Spencer
On Thu, 2007-03-29 at 22:59 -0700, Chris Lattner wrote:
> >
> > For PR789: http://llvm.org/PR789 :
> > * Add a method: bool isAbsolute() const, which determines if the  
> > path name
> >   is absolute or not.
> > * Implement caching of file status information in the Path object.  
> > Allow it
> >   to be updated forcefully or lazily re-fetched from the cached value.
> 
> Nice.  Instead of new'ing the status object separately from the Path  
> object, why not embed it by-value?

Because, by far, the common case for Path objects is to copy them around
and not use the FileStatus stuff.  I even hesitated about putting a
pointer into the Path object. :)

For example, this would bloat libLLVMArchive's memory usage
significantly. Other things are impacted to like llvmc, Linker, etc.

Reid.

> 
> -Chris
> 
> 
> 
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-03-29 Thread Chris Lattner

On Mar 29, 2007, at 11:17 PM, Reid Spencer wrote:

> On Thu, 2007-03-29 at 22:59 -0700, Chris Lattner wrote:
>>>
>>> For PR789: http://llvm.org/PR789 :
>>> * Add a method: bool isAbsolute() const, which determines if the
>>> path name
>>>   is absolute or not.
>>> * Implement caching of file status information in the Path object.
>>> Allow it
>>>   to be updated forcefully or lazily re-fetched from the cached  
>>> value.
>>
>> Nice.  Instead of new'ing the status object separately from the Path
>> object, why not embed it by-value?
>
> Because, by far, the common case for Path objects is to copy them  
> around
> and not use the FileStatus stuff.  I even hesitated about putting a
> pointer into the Path object. :)

Okay, how about an alternate approach, which fixes both problems :),  
how about something like this:

class PathWithStatus : public Path {
   Status S;
   bool IsStatusValid;
}

If you sink the 'status gathering' methods out of Path into  
PathWithStatus, then you let the client decide whether they want to  
store a status or not.

reasonable?

-Chris
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/include/llvm/System/Path.h

2007-03-29 Thread Reid Spencer
On Thu, 2007-03-29 at 23:28 -0700, Chris Lattner wrote:
> On Mar 29, 2007, at 11:17 PM, Reid Spencer wrote:
> 
> > On Thu, 2007-03-29 at 22:59 -0700, Chris Lattner wrote:
> >>>
> >>> For PR789: http://llvm.org/PR789 :
> >>> * Add a method: bool isAbsolute() const, which determines if the
> >>> path name
> >>>   is absolute or not.
> >>> * Implement caching of file status information in the Path object.
> >>> Allow it
> >>>   to be updated forcefully or lazily re-fetched from the cached  
> >>> value.
> >>
> >> Nice.  Instead of new'ing the status object separately from the Path
> >> object, why not embed it by-value?
> >
> > Because, by far, the common case for Path objects is to copy them  
> > around
> > and not use the FileStatus stuff.  I even hesitated about putting a
> > pointer into the Path object. :)
> 
> Okay, how about an alternate approach, which fixes both problems :),  
> how about something like this:
> 
> class PathWithStatus : public Path {
>Status S;
>bool IsStatusValid;
> }
> 
> If you sink the 'status gathering' methods out of Path into  
> PathWithStatus, then you let the client decide whether they want to  
> store a status or not.
> 
> reasonable?

Yes, that's quite reasonable. Could you file an enhancement PR with
this? I won't have time to get to such a large change for a while, and
don't want to forget.

Thanks,

Reid.

> 
> -Chris

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits