mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-13 15:37:24 +00:00
Add support for: -o -
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6485 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
eea93839eb
commit
3ce0ea8fd8
@ -53,14 +53,18 @@ int main(int argc, char **argv) {
|
||||
if (DumpAsm) std::cerr << "Here's the assembly:\n" << M.get();
|
||||
|
||||
if (OutputFilename != "") { // Specified an output filename?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists!\n"
|
||||
<< "Use -f command line argument to force output\n";
|
||||
return 1;
|
||||
if (OutputFilename != "-") { // Not stdout?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists!\n"
|
||||
<< "Use -f command line argument to force output\n";
|
||||
return 1;
|
||||
}
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
} else { // Specified stdout
|
||||
Out = &std::cout;
|
||||
}
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
} else {
|
||||
if (InputFilename == "-") {
|
||||
OutputFilename = "-";
|
||||
|
@ -31,7 +31,7 @@ static cl::opt<std::string>
|
||||
InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
|
||||
|
||||
static cl::opt<std::string>
|
||||
OutputFilename("o", cl::desc("Override output filename"),
|
||||
OutputFilename("o", cl::desc("Override output filename"),
|
||||
cl::value_desc("filename"));
|
||||
|
||||
static cl::opt<bool>
|
||||
@ -60,12 +60,14 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (OutputFilename != "") { // Specified an output filename?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists! Sending to standard output.\n";
|
||||
} else {
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
if (OutputFilename != "-") { // Not stdout?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists! Sending to standard output.\n";
|
||||
} else {
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (InputFilename == "-") {
|
||||
|
@ -53,14 +53,18 @@ int main(int argc, char **argv) {
|
||||
if (DumpAsm) std::cerr << "Here's the assembly:\n" << M.get();
|
||||
|
||||
if (OutputFilename != "") { // Specified an output filename?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists!\n"
|
||||
<< "Use -f command line argument to force output\n";
|
||||
return 1;
|
||||
if (OutputFilename != "-") { // Not stdout?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists!\n"
|
||||
<< "Use -f command line argument to force output\n";
|
||||
return 1;
|
||||
}
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
} else { // Specified stdout
|
||||
Out = &std::cout;
|
||||
}
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
} else {
|
||||
if (InputFilename == "-") {
|
||||
OutputFilename = "-";
|
||||
|
@ -53,14 +53,18 @@ int main(int argc, char **argv) {
|
||||
if (DumpAsm) std::cerr << "Here's the assembly:\n" << M.get();
|
||||
|
||||
if (OutputFilename != "") { // Specified an output filename?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists!\n"
|
||||
<< "Use -f command line argument to force output\n";
|
||||
return 1;
|
||||
if (OutputFilename != "-") { // Not stdout?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists!\n"
|
||||
<< "Use -f command line argument to force output\n";
|
||||
return 1;
|
||||
}
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
} else { // Specified stdout
|
||||
Out = &std::cout;
|
||||
}
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
} else {
|
||||
if (InputFilename == "-") {
|
||||
OutputFilename = "-";
|
||||
|
@ -31,7 +31,7 @@ static cl::opt<std::string>
|
||||
InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
|
||||
|
||||
static cl::opt<std::string>
|
||||
OutputFilename("o", cl::desc("Override output filename"),
|
||||
OutputFilename("o", cl::desc("Override output filename"),
|
||||
cl::value_desc("filename"));
|
||||
|
||||
static cl::opt<bool>
|
||||
@ -60,12 +60,14 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (OutputFilename != "") { // Specified an output filename?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists! Sending to standard output.\n";
|
||||
} else {
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
if (OutputFilename != "-") { // Not stdout?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists! Sending to standard output.\n";
|
||||
} else {
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (InputFilename == "-") {
|
||||
|
@ -31,7 +31,7 @@ static cl::opt<std::string>
|
||||
InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
|
||||
|
||||
static cl::opt<std::string>
|
||||
OutputFilename("o", cl::desc("Override output filename"),
|
||||
OutputFilename("o", cl::desc("Override output filename"),
|
||||
cl::value_desc("filename"));
|
||||
|
||||
static cl::opt<bool>
|
||||
@ -60,12 +60,14 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (OutputFilename != "") { // Specified an output filename?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists! Sending to standard output.\n";
|
||||
} else {
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
if (OutputFilename != "-") { // Not stdout?
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists! Sending to standard output.\n";
|
||||
} else {
|
||||
Out = new std::ofstream(OutputFilename.c_str());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (InputFilename == "-") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user