[llvm-commits] [hlvm] r38101 - /hlvm/trunk/tools/hlvm/hlvm.cpp
Reid Spencer
reid at x10sys.com
Sat Jul 7 16:59:50 PDT 2007
Author: reid
Date: Sat Jul 7 18:59:50 2007
New Revision: 38101
URL: http://llvm.org/viewvc/llvm-project?rev=38101&view=rev
Log:
Don't make this a clone of hlvm-xml2xml, but have it print out a message
indicating that its not implemented yet.
Modified:
hlvm/trunk/tools/hlvm/hlvm.cpp
Modified: hlvm/trunk/tools/hlvm/hlvm.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/tools/hlvm/hlvm.cpp?rev=38101&r1=38100&r2=38101&view=diff
==============================================================================
--- hlvm/trunk/tools/hlvm/hlvm.cpp (original)
+++ hlvm/trunk/tools/hlvm/hlvm.cpp Sat Jul 7 18:59:50 2007
@@ -38,71 +38,16 @@
using namespace llvm;
using namespace hlvm;
static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input XML>"), cl::init("-"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"),
- cl::value_desc("filename"));
+ProgramToRun(cl::Positional, cl::desc("URI Of Program To Run"));
int main(int argc, char**argv)
{
try {
Base::initialize(argc,argv);
cl::ParseCommandLineOptions(argc, argv,
- "hlvm-xml2xml XML->AST->XML translator\n");
-
- std::ostream *Out = &std::cout; // Default to printing to stdout.
-
- if (OutputFilename != "") { // Specified an output filename?
- if (OutputFilename != "-") { // Not stdout?
- Out = new std::ofstream(OutputFilename.c_str());
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
- }
- } else {
- if (InputFilename == "-") {
- OutputFilename = "-";
- } else {
- std::string IFN = InputFilename;
- OutputFilename = InputFilename + ".out";
-
- Out = new std::ofstream(OutputFilename.c_str());
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
- }
- }
-
- if (!Out->good()) {
- std::cerr << argv[0] << ": error opening " << OutputFilename
- << ": sending to stdout instead!\n";
- Out = &std::cout;
- }
-
- if (InputFilename == "-" ) {
- std::cerr << "Not supported yet: input from stdin\n";
- exit(2);
- } else {
- llvm::sys::Path path(InputFilename);
- if (!path.canRead()) {
- std::cerr << argv[0] << ": can't read input file: " << InputFilename
- << "\n";
- exit(2);
- }
- }
-
- XMLReader* rdr = XMLReader::create(InputFilename);
- XMLWriter* wrtr = XMLWriter::create(OutputFilename.c_str());
- rdr->read();
- AST* node = rdr->get();
- if (node) {
- wrtr->write(node);
- }
- delete rdr;
- delete wrtr;
+ "hlvm: High Level Virtual Machine\n");
- if (Out != &std::cout) {
- static_cast<std::ofstream*>(Out)->close();
- delete Out;
- }
- return 0;
+ std::cout << "Unfortunately, the hlvm virtual machine isn't implemented.\n";
} catch (const std::string& msg) {
std::cerr << argv[0] << ": " << msg << "\n";
} catch (...) {
More information about the llvm-commits
mailing list