Catch a potentially thrown exception.

llvm-svn: 28295
This commit is contained in:
Chris Lattner committed 2006-05-14 19:08:39 +00:00
1 parent a8a550f1e3
commit 5eae951603
1 file changed
+6 -1
+6 -1
View File
@@ -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;