[llvm-commits] CVS: llvm/lib/System/Win32/Path.inc

Reid Spencer reid at x10sys.com
Tue Aug 22 23:56:48 PDT 2006



Changes in directory llvm/lib/System/Win32:

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

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


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

 Path.inc |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)


Index: llvm/lib/System/Win32/Path.inc
diff -u llvm/lib/System/Win32/Path.inc:1.53 llvm/lib/System/Win32/Path.inc:1.54
--- llvm/lib/System/Win32/Path.inc:1.53	Tue Aug 22 18:54:35 2006
+++ llvm/lib/System/Win32/Path.inc	Wed Aug 23 01:56:27 2006
@@ -353,9 +353,11 @@
 }
 
 bool
-Path::getDirectoryContents(std::set<Path>& result) const {
-  if (!isDirectory())
-    return false;
+Path::getDirectoryContents(std::set<Path>& result, std::string* ErrMsg) const {
+  if (!isDirectory()) {
+    MakeErrMsg(ErrMsg, path + ": not a directory");
+    return true;
+  }
 
   result.clear();
   WIN32_FIND_DATA fd;
@@ -369,7 +371,8 @@
   if (h == INVALID_HANDLE_VALUE) {
     if (GetLastError() == ERROR_FILE_NOT_FOUND)
       return true; // not really an error, now is it?
-    ThrowError(path + ": Can't read directory: ");
+    MakeErrMsg(ErrMsg, path + ": Can't read directory: ");
+    return true;
   }
 
   do {
@@ -384,9 +387,10 @@
   FindClose(h);
   if (err != ERROR_NO_MORE_FILES) {
     SetLastError(err);
-    ThrowError(path + ": Can't read directory: ");
+    MakeErrMsg(ErrMsg, path + ": Can't read directory: ");
+    return true;
   }
-  return true;
+  return false;
 }
 
 bool






More information about the llvm-commits mailing list