diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-05-06 18:39:28 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-05-06 18:39:28 +0000 |
commit | 763ac0397ea8b40492cbebee5f61b89c49820502 (patch) | |
tree | 4ca68d2ba474da658c1cf2cc6e3320fa2f53ec04 /llvm | |
parent | dc3d8ffbe981ca0bb6604cf9ad985fa12974b652 (diff) | |
download | bcm5719-llvm-763ac0397ea8b40492cbebee5f61b89c49820502.tar.gz bcm5719-llvm-763ac0397ea8b40492cbebee5f61b89c49820502.zip |
ParseFile() may throw, so extend the try/catch to handle that.
llvm-svn: 131004
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/utils/TableGen/TableGen.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/TableGen.cpp index aa923025242..d88a2d6a0e2 100644 --- a/llvm/utils/TableGen/TableGen.cpp +++ b/llvm/utils/TableGen/TableGen.cpp @@ -228,19 +228,19 @@ int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv); - // Parse the input file. - if (ParseFile(InputFilename, IncludeDirs, SrcMgr, Records)) - return 1; + try { + // Parse the input file. + if (ParseFile(InputFilename, IncludeDirs, SrcMgr, Records)) + return 1; - std::string Error; - tool_output_file Out(OutputFilename.c_str(), Error); - if (!Error.empty()) { - errs() << argv[0] << ": error opening " << OutputFilename - << ":" << Error << "\n"; - return 1; - } + std::string Error; + tool_output_file Out(OutputFilename.c_str(), Error); + if (!Error.empty()) { + errs() << argv[0] << ": error opening " << OutputFilename + << ":" << Error << "\n"; + return 1; + } - try { switch (Action) { case PrintRecords: Out.os() << Records; // No argument, dump all contents |