diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2006-08-22 16:07:44 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2006-08-22 16:07:44 +0000 |
| commit | 64c5920336da876cf9386f87abdd67529c3df524 (patch) | |
| tree | 6192ab7b7c7a400693d045574382de4eb365e2d8 /llvm/lib/Bytecode/Archive/Archive.cpp | |
| parent | efdc3a13cdccf11fe33773e724ff40ffa8c733b0 (diff) | |
| download | bcm5719-llvm-64c5920336da876cf9386f87abdd67529c3df524.tar.gz bcm5719-llvm-64c5920336da876cf9386f87abdd67529c3df524.zip | |
For PR797:
Adjust to new interface for MappedFile. Note that the new "throw"
statements will be removed later.
llvm-svn: 29818
Diffstat (limited to 'llvm/lib/Bytecode/Archive/Archive.cpp')
| -rw-r--r-- | llvm/lib/Bytecode/Archive/Archive.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Bytecode/Archive/Archive.cpp b/llvm/lib/Bytecode/Archive/Archive.cpp index 3bb9a055083..d5b56ca85e2 100644 --- a/llvm/lib/Bytecode/Archive/Archive.cpp +++ b/llvm/lib/Bytecode/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; } } |

