mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-03 15:36:21 +00:00
Catch a potentially thrown exception.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28295 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
59e8de386d
commit
b461131c99
@ -54,7 +54,12 @@ int main() {
|
||||
BB->getInstList().push_back(new ReturnInst(Add));
|
||||
|
||||
// Output the bytecode file to stdout
|
||||
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