summaryrefslogtreecommitdiff
path: root/lib/Bytecode
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
commit252ad03d7db0add504fdcc6bd67c1bc1e28bdd57 (patch)
treeb53953cdbf21813671a66e76191e4bd39c4bf6e7 /lib/Bytecode
parent3236ced25f152ca3035b335008056cd91af5f8bf (diff)
downloadllvm-252ad03d7db0add504fdcc6bd67c1bc1e28bdd57.tar.gz
llvm-252ad03d7db0add504fdcc6bd67c1bc1e28bdd57.tar.bz2
llvm-252ad03d7db0add504fdcc6bd67c1bc1e28bdd57.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Archive/Archive.cpp6
-rw-r--r--lib/Bytecode/Archive/ArchiveWriter.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/Bytecode/Archive/Archive.cpp b/lib/Bytecode/Archive/Archive.cpp
index 66b9d703a0..3bb9a05508 100644
--- a/lib/Bytecode/Archive/Archive.cpp
+++ b/lib/Bytecode/Archive/Archive.cpp
@@ -104,12 +104,14 @@ void ArchiveMember::replaceWith(const sys::Path& newFile) {
flags &= ~HasLongFilenameFlag;
// Get the signature and status info
- std::string magic;
const char* signature = (const char*) data;
+ std::string magic;
if (!signature) {
path.getMagicNumber(magic,4);
signature = magic.c_str();
- path.getStatusInfo(info);
+ std::string err;
+ if (path.getFileStatus(info, &err))
+ throw err;
}
// Determine what kind of file it is
diff --git a/lib/Bytecode/Archive/ArchiveWriter.cpp b/lib/Bytecode/Archive/ArchiveWriter.cpp
index 390fd12851..52ba99e805 100644
--- a/lib/Bytecode/Archive/ArchiveWriter.cpp
+++ b/lib/Bytecode/Archive/ArchiveWriter.cpp
@@ -159,7 +159,9 @@ Archive::addFileBefore(const sys::Path& filePath, iterator where) {
mbr->data = 0;
mbr->path = filePath;
- mbr->path.getStatusInfo(mbr->info);
+ std::string err;
+ if (mbr->path.getFileStatus(mbr->info, &err))
+ throw err;
unsigned flags = 0;
bool hasSlash = filePath.toString().find('/') != std::string::npos;