aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-08-22 16:06:27 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-08-22 16:06:27 +0000
commit862796959796d69fa490107d880854739660ffad (patch)
treef4bdf140c1ad22f60b8f3837f1ec02f9121e31b3 /include/llvm
parent6d045fcdcd4fe83f51050f6601726d29b2689526 (diff)
downloadexternal_llvm-862796959796d69fa490107d880854739660ffad.zip
external_llvm-862796959796d69fa490107d880854739660ffad.tar.gz
external_llvm-862796959796d69fa490107d880854739660ffad.tar.bz2
For PR797:
Adjust users of MappedFile to its new non-throwing interface. Note that in most cases the lazy step of just throwing after a call to MappedFile was installed. This was done in the name of incremental changes. Getting rid of the new throw statements will take adjustment of interfaces and propagation of errors to higher levels. Those changes will come in subsequent patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Debugger/SourceFile.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/Debugger/SourceFile.h b/include/llvm/Debugger/SourceFile.h
index 6d49fbe..e54660c 100644
--- a/include/llvm/Debugger/SourceFile.h
+++ b/include/llvm/Debugger/SourceFile.h
@@ -50,7 +50,10 @@ namespace llvm {
/// reading it, or if the user cancels the operation. Instead, it will just
/// be an empty source file.
SourceFile(const std::string &fn, const GlobalVariable *Desc)
- : Filename(fn), Descriptor(Desc), File(Filename) {
+ : Filename(fn), Descriptor(Desc), File() {
+ std::string ErrMsg;
+ if (File.open(Filename, sys::MappedFile::READ_ACCESS, &ErrMsg))
+ throw ErrMsg;
readFile();
}
~SourceFile() {