mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-22 20:05:38 +00:00
Catch a potentially thrown exception.
llvm-svn: 28295
This commit is contained in:
parent
96c4ae0fa3
commit
e09437b26e
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user