Removed silly test code
authorChris Lattner <sabre@nondot.org>
Wed, 13 Jun 2001 19:55:50 +0000 (19:55 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 13 Jun 2001 19:55:50 +0000 (19:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31 91177308-0d34-0410-b5e6-96231b3b80d8

tools/opt/opt.cpp

index ff513d75a31364b88e3edffa0e76361daedbde25..9485562ab1b4fc404763a103eda9a1e68d089f93 100644 (file)
@@ -16,8 +16,6 @@
 //
 // TODO: Add a -all option to keep applying all optimizations until the program
 //       stops permuting.
-// TODO: Add a -h command line arg that prints all available optimizations
-// TODO: Add a -q command line arg that quiets "XXX pass made modifications"
 //
 //===------------------------------------------------------------------------===
 
 #include "llvm/Tools/CommandLine.h"
 #include "llvm/Opt/AllOpts.h"
 
-#if 1  // Testcase, TODO: REMOVE
-#include "llvm/CFG.h"
-#include "llvm/Assembly/Writer.h"
-#include "llvm/Method.h"
-static bool DoPrintM(Method *M) {
-  df_iterator I = df_begin(M->getBasicBlocks().front(), false);
-  df_iterator E = df_end(M->getBasicBlocks().front());
-  unsigned i = 0;
-  for (; I != E; ++I, ++i) {
-    cerr << "Basic Block Visited #" << i << *I;
-  }
-  return false;
-}
-
-static bool DoPrint(Module *C) {
-  return ApplyOptToAllMethods(C, DoPrintM);
-}
-#endif
-
 struct {
   const string ArgName, Name;
   bool (*OptPtr)(Module *C);
@@ -57,7 +36,6 @@ struct {
   { "-inline"   ,"Method Inlining",       DoMethodInlining      },
   { "-strip"    ,"Strip Symbols",         DoSymbolStripping     },
   { "-mstrip"   ,"Strip Module Symbols",  DoFullSymbolStripping },
-  { "-print"    ,"Test printing stuff",   DoPrint               },
 };
 
 int main(int argc, char **argv) {
@@ -68,6 +46,10 @@ int main(int argc, char **argv) {
     if (string(argv[i]) == string("--help")) {
       cerr << argv[0] << " usage:\n"
            << "  " << argv[0] << " --help  - Print this usage information\n";
+      for (unsigned j = 0; j < sizeof(OptTable)/sizeof(OptTable[0]); ++j) {
+       cerr << "\t" << OptTable[j].ArgName << "\t - Enable " 
+            << OptTable[j].Name << endl;
+      }
       return 1;
     } else if (string(argv[i]) == string("-q")) {
       Quiet = true; argv[i] = 0;