summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-ar/llvm-ar.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-28 22:03:44 +0000
committerChris Lattner <sabre@nondot.org>2006-07-28 22:03:44 +0000
commit4857253d98638b9d5aedd1e4b854b8a2f61ff114 (patch)
tree0547c61f3117040e6c9642ac2a5e30f9349aafa5 /llvm/tools/llvm-ar/llvm-ar.cpp
parent6da9d8ecf9fee8e64f922021592e3aeb1a2445bf (diff)
downloadbcm5719-llvm-4857253d98638b9d5aedd1e4b854b8a2f61ff114.tar.gz
bcm5719-llvm-4857253d98638b9d5aedd1e4b854b8a2f61ff114.zip
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. llvm-svn: 29395
Diffstat (limited to 'llvm/tools/llvm-ar/llvm-ar.cpp')
-rw-r--r--llvm/tools/llvm-ar/llvm-ar.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index 8bc9e048daf..2ec431727a6 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -299,8 +299,10 @@ void buildPaths(bool checkExistence = true) {
if (checkExistence) {
if (!aPath.exists())
throw std::string("File does not exist: ") + Members[i];
- sys::Path::StatusInfo si;
- aPath.getStatusInfo(si);
+ sys::FileStatus si;
+ std::string Err;
+ if (aPath.getFileStatus(si, &Err))
+ throw Err;
if (si.isDir) {
std::set<sys::Path> dirpaths = recurseDirectories(aPath);
Paths.insert(dirpaths.begin(),dirpaths.end());
@@ -456,7 +458,7 @@ void doExtract() {
// If we're supposed to retain the original modification times, etc. do so
// now.
if (OriginalDates)
- I->getPath().setStatusInfoOnDisk(I->getStatusInfo());
+ I->getPath().setStatusInfoOnDisk(I->getFileStatus());
}
}
}
@@ -610,8 +612,10 @@ void doReplaceOrInsert() {
}
if (found != remaining.end()) {
- sys::Path::StatusInfo si;
- found->getStatusInfo(si);
+ sys::FileStatus si;
+ std::string Err;
+ if (found->getFileStatus(si, &Err))
+ throw Err;
if (si.isDir) {
if (OnlyUpdate) {
// Replace the item only if it is newer.
OpenPOWER on IntegriCloud