summaryrefslogtreecommitdiff
path: root/lib/Archive/Archive.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-08-22 16:07:44 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-08-22 16:07:44 +0000
commit751ca6b48cb741797c513fa0e9df369ebd7e4aa5 (patch)
tree3ba2c551590bdb2143ca204dc05f94fb6508b09e /lib/Archive/Archive.cpp
parent862796959796d69fa490107d880854739660ffad (diff)
downloadllvm-751ca6b48cb741797c513fa0e9df369ebd7e4aa5.tar.gz
llvm-751ca6b48cb741797c513fa0e9df369ebd7e4aa5.tar.bz2
llvm-751ca6b48cb741797c513fa0e9df369ebd7e4aa5.tar.xz
For PR797:
Adjust to new interface for MappedFile. Note that the new "throw" statements will be removed later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29818 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive/Archive.cpp')
-rw-r--r--lib/Archive/Archive.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp
index 3bb9a05508..d5b56ca85e 100644
--- a/lib/Archive/Archive.cpp
+++ b/lib/Archive/Archive.cpp
@@ -137,8 +137,12 @@ Archive::Archive(const sys::Path& filename, bool map )
symTabSize(0), firstFileOffset(0), modules(), foreignST(0)
{
if (map) {
- mapfile = new sys::MappedFile(filename);
- base = (char*) mapfile->map();
+ std::string ErrMsg;
+ mapfile = new sys::MappedFile();
+ if (mapfile->open(filename, sys::MappedFile::READ_ACCESS, &ErrMsg))
+ throw ErrMsg;
+ if (!(base = (char*) mapfile->map(&ErrMsg)))
+ throw ErrMsg;
}
}