mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
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
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user