mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
Kill using declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6292 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -17,13 +17,11 @@
|
||||
#include "Support/Signals.h"
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
using std::cerr;
|
||||
using std::string;
|
||||
|
||||
static cl::opt<string>
|
||||
static cl::opt<std::string>
|
||||
InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-"));
|
||||
|
||||
static cl::opt<string>
|
||||
static cl::opt<std::string>
|
||||
OutputFilename("o", cl::desc("Override output filename"),
|
||||
cl::value_desc("filename"));
|
||||
|
||||
@ -41,24 +39,25 @@ int main(int argc, char **argv) {
|
||||
// Parse the file now...
|
||||
std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename));
|
||||
if (M.get() == 0) {
|
||||
cerr << argv[0] << ": assembly didn't read correctly.\n";
|
||||
std::cerr << argv[0] << ": assembly didn't read correctly.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (verifyModule(*M.get())) {
|
||||
cerr << argv[0] << ": assembly parsed, but does not verify as correct!\n";
|
||||
std::cerr << argv[0]
|
||||
<< ": assembly parsed, but does not verify as correct!\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if (DumpAsm) cerr << "Here's the assembly:\n" << M.get();
|
||||
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!
|
||||
cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists!\n"
|
||||
<< "Use -f command line argument to force output\n";
|
||||
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());
|
||||
@ -79,9 +78,9 @@ int main(int argc, char **argv) {
|
||||
|
||||
if (!Force && std::ifstream(OutputFilename.c_str())) {
|
||||
// If force is not specified, make sure not to overwrite a file!
|
||||
cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists!\n"
|
||||
<< "Use -f command line argument to force output\n";
|
||||
std::cerr << argv[0] << ": error opening '" << OutputFilename
|
||||
<< "': file exists!\n"
|
||||
<< "Use -f command line argument to force output\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -93,13 +92,13 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (!Out->good()) {
|
||||
cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
|
||||
std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
WriteBytecodeToFile(M.get(), *Out);
|
||||
} catch (const ParseException &E) {
|
||||
cerr << argv[0] << ": " << E.getMessage() << "\n";
|
||||
std::cerr << argv[0] << ": " << E.getMessage() << "\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user