aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-28 22:29:50 +0000
committerChris Lattner <sabre@nondot.org>2006-07-28 22:29:50 +0000
commit0c33231eff17edbdabdb186e1fae718cf94b58b2 (patch)
treeb7b5e08357f3a04f92267bbbc0ee9d8915a82900 /include
parent65a392ebeae214ccb25f4d5ec856688e4e690e0d (diff)
downloadexternal_llvm-0c33231eff17edbdabdb186e1fae718cf94b58b2.zip
external_llvm-0c33231eff17edbdabdb186e1fae718cf94b58b2.tar.gz
external_llvm-0c33231eff17edbdabdb186e1fae718cf94b58b2.tar.bz2
Modify Path::eraseFromDisk to not throw an exception.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/FileUtilities.h8
-rw-r--r--include/llvm/System/Path.h10
2 files changed, 8 insertions, 10 deletions
diff --git a/include/llvm/Support/FileUtilities.h b/include/llvm/Support/FileUtilities.h
index 67eb3bb..d0d193d 100644
--- a/include/llvm/Support/FileUtilities.h
+++ b/include/llvm/Support/FileUtilities.h
@@ -43,10 +43,10 @@ namespace llvm {
: Filename(filename), DeleteIt(deleteIt) {}
~FileRemover() {
- if (DeleteIt)
- try {
- Filename.eraseFromDisk();
- } catch (...) {} // Ignore problems deleting the file.
+ if (DeleteIt) {
+ // Ignore problems deleting the file.
+ Filename.eraseFromDisk();
+ }
}
/// releaseFile - Take ownership of the file away from the FileRemover so it
diff --git a/include/llvm/System/Path.h b/include/llvm/System/Path.h
index f8ff8f4..14602d7 100644
--- a/include/llvm/System/Path.h
+++ b/include/llvm/System/Path.h
@@ -522,17 +522,15 @@ namespace sys {
/// \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.
/// @}
};