diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2006-08-23 06:56:27 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2006-08-23 06:56:27 +0000 |
| commit | 51edba15c6a11fd79e60039264bee8daa2f14cd0 (patch) | |
| tree | f005d1dbd5aa2b0c90fb60850774e5b834c96097 /llvm/lib/System/Win32 | |
| parent | 8db844241b25c5a350d3edeeac459fca69c7ae51 (diff) | |
| download | bcm5719-llvm-51edba15c6a11fd79e60039264bee8daa2f14cd0.tar.gz bcm5719-llvm-51edba15c6a11fd79e60039264bee8daa2f14cd0.zip | |
For PR797:
Remove exception throwing from Path::getDirectoryContents and its users.
llvm-svn: 29841
Diffstat (limited to 'llvm/lib/System/Win32')
| -rw-r--r-- | llvm/lib/System/Win32/Path.inc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/System/Win32/Path.inc b/llvm/lib/System/Win32/Path.inc index 2f2e8520133..913a4091aca 100644 --- a/llvm/lib/System/Win32/Path.inc +++ b/llvm/lib/System/Win32/Path.inc @@ -353,9 +353,11 @@ bool Path::makeExecutableOnDisk(std::string* ErrMsg) { } 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 @@ Path::getDirectoryContents(std::set<Path>& result) const { 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 @@ Path::getDirectoryContents(std::set<Path>& result) const { 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 |

