diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-24 01:15:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-24 01:15:12 +0000 |
commit | d6b65255fec99708c8317cde601b12ec09f538d9 (patch) | |
tree | 41cdf3fcc7de3725ca3b11c7868bafad81db81b3 /tools/llvm-link | |
parent | 88dedc1544a5c7235b49b4d9b14f8beeb95317e2 (diff) |
Changes to get some meaningful feedback from the bytecode reader. At some point this stuff should all be exception driven, but for now it is not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@970 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-link')
-rw-r--r-- | tools/llvm-link/llvm-link.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp index cdd5434611..0ae39228d9 100644 --- a/tools/llvm-link/llvm-link.cpp +++ b/tools/llvm-link/llvm-link.cpp @@ -33,26 +33,30 @@ int main(int argc, char **argv) { assert(InputFilenames.size() > 0 && "OneOrMore is not working"); // TODO: TEST argv[0] - - + string ErrorMessage; + if (Verbose) cerr << "Loading '" << InputFilenames[0] << "'\n"; - std::auto_ptr<Module> Composite(ParseBytecodeFile(InputFilenames[0])); + std::auto_ptr<Module> Composite(ParseBytecodeFile(InputFilenames[0], + &ErrorMessage)); if (Composite.get() == 0) { - cerr << "Error opening bytecode file: '" << InputFilenames[0] << "'\n"; + cerr << "Error opening bytecode file: '" << InputFilenames[0] << "'"; + if (ErrorMessage.size()) cerr << ": " << ErrorMessage; + cerr << endl; return 1; } for (unsigned i = 1; i < InputFilenames.size(); ++i) { if (Verbose) cerr << "Loading '" << InputFilenames[i] << "'\n"; - auto_ptr<Module> M(ParseBytecodeFile(InputFilenames[i])); + auto_ptr<Module> M(ParseBytecodeFile(InputFilenames[i], &ErrorMessage)); if (M.get() == 0) { - cerr << "Error opening bytecode file: '" << InputFilenames[i] << "'\n"; + cerr << "Error opening bytecode file: '" << InputFilenames[i] << "'"; + if (ErrorMessage.size()) cerr << ": " << ErrorMessage; + cerr << endl; return 1; } if (Verbose) cerr << "Linking in '" << InputFilenames[i] << "'\n"; - string ErrorMessage; if (LinkModules(Composite.get(), M.get(), &ErrorMessage)) { cerr << "Error linking in '" << InputFilenames[i] << "': " << ErrorMessage << endl; |