Changes in directory llvm/tools/bugpoint:
BugDriver.cpp updated: 1.43 -> 1.44 --- Log message: print a nice error if bugpoint gets an error reading inputs. Bug identified by coverity. --- Diffs of the changes: (+21 -16) BugDriver.cpp | 37 +++++++++++++++++++++---------------- 1 files changed, 21 insertions(+), 16 deletions(-) Index: llvm/tools/bugpoint/BugDriver.cpp diff -u llvm/tools/bugpoint/BugDriver.cpp:1.43 llvm/tools/bugpoint/BugDriver.cpp:1.44 --- llvm/tools/bugpoint/BugDriver.cpp:1.43 Thu Dec 22 14:02:55 2005 +++ llvm/tools/bugpoint/BugDriver.cpp Sun May 14 14:15:56 2006 @@ -94,24 +94,29 @@ assert(Program == 0 && "Cannot call addSources multiple times!"); assert(!Filenames.empty() && "Must specify at least on input filename!"); - // Load the first input file... - Program = ParseInputFile(Filenames[0]); - if (Program == 0) return true; - if (!run_as_child) - std::cout << "Read input file : '" << Filenames[0] << "'\n"; - - for (unsigned i = 1, e = Filenames.size(); i != e; ++i) { - std::auto_ptr<Module> M(ParseInputFile(Filenames[i])); - if (M.get() == 0) return true; - + try { + // Load the first input file. + Program = ParseInputFile(Filenames[0]); + if (Program == 0) return true; if (!run_as_child) - std::cout << "Linking in input file: '" << Filenames[i] << "'\n"; - std::string ErrorMessage; - if (Linker::LinkModules(Program, M.get(), &ErrorMessage)) { - std::cerr << ToolName << ": error linking in '" << Filenames[i] << "': " - << ErrorMessage << '\n'; - return true; + std::cout << "Read input file : '" << Filenames[0] << "'\n"; + + for (unsigned i = 1, e = Filenames.size(); i != e; ++i) { + std::auto_ptr<Module> M(ParseInputFile(Filenames[i])); + if (M.get() == 0) return true; + + if (!run_as_child) + std::cout << "Linking in input file: '" << Filenames[i] << "'\n"; + std::string ErrorMessage; + if (Linker::LinkModules(Program, M.get(), &ErrorMessage)) { + std::cerr << ToolName << ": error linking in '" << Filenames[i] << "': " + << ErrorMessage << '\n'; + return true; + } } + } catch (const std::string &Error) { + std::cerr << ToolName << ": error reading input '" << Error << "'\n"; + return true; } if (!run_as_child) _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits