mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
- Unify format of output messages
- All errors throw std::string - Default output file name to a.out (if we're linking) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16025 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
02413b0294
commit
2cf17a4f0f
@ -214,11 +214,14 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
// Deal with unimplemented options.
|
// Deal with unimplemented options.
|
||||||
if (PipeCommands)
|
if (PipeCommands)
|
||||||
std::cerr << argv[0] << ": Not implemented yet: -pipe";
|
throw "Not implemented yet: -pipe";
|
||||||
|
|
||||||
// Default the output file, only if we're going to try to link
|
if (OutputFilename.empty())
|
||||||
if (OutputFilename.empty() && OptLevel == CompilerDriver::LINKING)
|
if (OptLevel == CompilerDriver::LINKING)
|
||||||
OutputFilename = "a.out";
|
OutputFilename = "a.out";
|
||||||
|
else
|
||||||
|
throw "An output file must be specified. Please use the -o option";
|
||||||
|
|
||||||
|
|
||||||
// Construct the ConfigDataProvider object
|
// Construct the ConfigDataProvider object
|
||||||
LLVMC_ConfigDataProvider Provider;
|
LLVMC_ConfigDataProvider Provider;
|
||||||
@ -283,15 +286,15 @@ int main(int argc, char **argv) {
|
|||||||
// Tell the driver to do its thing
|
// Tell the driver to do its thing
|
||||||
int result = CD.execute(InpList,OutputFilename);
|
int result = CD.execute(InpList,OutputFilename);
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
std::cerr << argv[0] << ": Error executing actions. Terminated.\n";
|
throw "Error executing actions. Terminated.\n";
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// All is good, return success
|
// All is good, return success
|
||||||
return 0;
|
return 0;
|
||||||
} catch (std::string& msg) {
|
} catch (std::string& msg) {
|
||||||
std::cerr << msg << "\n";
|
std::cerr << argv[0] << ": " << msg << "\n";
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
std::cerr << "Unexpected unknown exception occurred.\n";
|
std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user