diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-08-24 23:45:08 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-08-24 23:45:08 +0000 |
commit | 0ff2d31766209ce1a69d4d2c5d35761ef57362aa (patch) | |
tree | cc950d878d90c6ccb0836cf35ac004f32bc4fba1 /tools/llvm-ar | |
parent | c82b3aab6502a9766ddf42b45faeca3d6fa0ad65 (diff) | |
download | external_llvm-0ff2d31766209ce1a69d4d2c5d35761ef57362aa.zip external_llvm-0ff2d31766209ce1a69d4d2c5d35761ef57362aa.tar.gz external_llvm-0ff2d31766209ce1a69d4d2c5d35761ef57362aa.tar.bz2 |
For PR797:
Remove exception handling from the bytecode archiver and adjust the llvm-ar
tool to accommodate the new interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ar')
-rw-r--r-- | tools/llvm-ar/llvm-ar.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index f266e1f..55a60a3 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/tools/llvm-ar/llvm-ar.cpp @@ -586,7 +586,8 @@ doQuickAppend(std::string* ErrMsg) { // Append them quickly. for (std::set<sys::Path>::iterator PI = Paths.begin(), PE = Paths.end(); PI != PE; ++PI) { - TheArchive->addFileBefore(*PI,TheArchive->end()); + if (TheArchive->addFileBefore(*PI,TheArchive->end(),ErrMsg)) + return true; } // We're done editting, reconstruct the archive. @@ -647,15 +648,17 @@ doReplaceOrInsert(std::string* ErrMsg) { sys::FileStatus si; std::string Err; if (found->getFileStatus(si, &Err)) - throw Err; + return true; if (si.isDir) { if (OnlyUpdate) { // Replace the item only if it is newer. if (si.modTime > I->getModTime()) - I->replaceWith(*found); + if (I->replaceWith(*found, ErrMsg)) + return true; } else { // Replace the item regardless of time stamp - I->replaceWith(*found); + if (I->replaceWith(*found, ErrMsg)) + return true; } } else { // We purposefully ignore directories. @@ -679,7 +682,8 @@ doReplaceOrInsert(std::string* ErrMsg) { if (!remaining.empty()) { for (std::set<sys::Path>::iterator PI = remaining.begin(), PE = remaining.end(); PI != PE; ++PI) { - TheArchive->addFileBefore(*PI,insert_spot); + if (TheArchive->addFileBefore(*PI,insert_spot, ErrMsg)) + return true; } } |