projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59e8de3
)
Catch a potentially thrown exception.
author
Chris Lattner
<sabre@nondot.org>
Sun, 14 May 2006 19:08:39 +0000
(19:08 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Sun, 14 May 2006 19:08:39 +0000
(19:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28295
91177308
-0d34-0410-b5e6-
96231b3b80d8
examples/ModuleMaker/ModuleMaker.cpp
patch
|
blob
|
history
diff --git
a/examples/ModuleMaker/ModuleMaker.cpp
b/examples/ModuleMaker/ModuleMaker.cpp
index 04c6a9f95bf7c1102580697221bf10d2a6208cd7..4c09db4df751f01b1c548304bc887fb4ce85576f 100644
(file)
--- a/
examples/ModuleMaker/ModuleMaker.cpp
+++ b/
examples/ModuleMaker/ModuleMaker.cpp
@@
-54,7
+54,12
@@
int main() {
BB->getInstList().push_back(new ReturnInst(Add));
// Output the bytecode file to stdout
- WriteBytecodeToFile(M, std::cout);
+ try {
+ WriteBytecodeToFile(M, std::cout);
+ } catch (const std::string &Error) {
+ std::cerr << "Error writing file: " << Error << "\n";
+ return 1;
+ }
// Delete the module and all of its contents.
delete M;