*** empty log message ***
authorChris Lattner <sabre@nondot.org>
Mon, 22 Jul 2002 02:10:13 +0000 (02:10 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 22 Jul 2002 02:10:13 +0000 (02:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2985 91177308-0d34-0410-b5e6-96231b3b80d8

31 files changed:
lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
lib/CodeGen/InstrSched/InstrScheduling.cpp
lib/CodeGen/InstrSelection/InstrSelection.cpp
lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
lib/ExecutionEngine/Interpreter/Execution.cpp
lib/Support/Statistic.cpp
lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
lib/Transforms/IPO/OldPoolAllocate.cpp
lib/Transforms/Instrumentation/TraceValues.cpp
lib/Transforms/LevelRaise.cpp
lib/VMCore/Pass.cpp
support/lib/Support/Statistic.cpp
support/lib/Support/StatisticReporter.cpp
tools/as/as.cpp
tools/dis/dis.cpp
tools/extract/extract.cpp
tools/gccas/gccas.cpp
tools/gccld/gccld.cpp
tools/link/link.cpp
tools/llc/llc.cpp
tools/lli/lli.cpp
tools/llvm-as/as.cpp
tools/llvm-as/llvm-as.cpp
tools/llvm-dis/dis.cpp
tools/llvm-dis/llvm-dis.cpp
tools/llvm-extract/llvm-extract.cpp
tools/llvm-link/llvm-link.cpp
tools/opt/opt.cpp

index 774bdc7cd7bcfb93124f08bfd74d33d06447a758..b080ec2f3e2db69955ccf48e916dc9aab26dcc41 100644 (file)
@@ -19,12 +19,16 @@ AnalysisID FunctionLiveVarInfo::ID(AnalysisID::create<FunctionLiveVarInfo>());
 
 LiveVarDebugLevel_t DEBUG_LV;
 
-static cl::Enum<LiveVarDebugLevel_t> DEBUG_LV_opt(DEBUG_LV, "dlivevar", cl::Hidden,
-  "enable live-variable debugging information",
-  clEnumValN(LV_DEBUG_None   , "n", "disable debug output"),
-  clEnumValN(LV_DEBUG_Normal , "y", "enable debug output"),
-  clEnumValN(LV_DEBUG_Instr,   "i", "print live-var sets before/after every machine instrn"),
-  clEnumValN(LV_DEBUG_Verbose, "v", "print def, use sets for every instrn also"), 0);
+static cl::opt<LiveVarDebugLevel_t, true>
+DEBUG_LV_opt("dlivevar", cl::Hidden, cl::location(DEBUG_LV),
+             cl::desc("enable live-variable debugging information"),
+             cl::values(
+clEnumValN(LV_DEBUG_None   , "n", "disable debug output"),
+clEnumValN(LV_DEBUG_Normal , "y", "enable debug output"),
+clEnumValN(LV_DEBUG_Instr,   "i", "print live-var sets before/after "
+           "every machine instrn"),
+clEnumValN(LV_DEBUG_Verbose, "v", "print def, use sets for every instrn also"),
+                        0));
 
 
 
index 6ea37247d0935c30b828b4ec3ab9b722e5776678..1d4c18058f3dc9598d9d29428d7f85bc1da93a1e 100644 (file)
@@ -21,13 +21,16 @@ using std::vector;
 
 SchedDebugLevel_t SchedDebugLevel;
 
-static cl::Enum<enum SchedDebugLevel_t> Opt(SchedDebugLevel,"dsched",cl::Hidden,
-  "enable instruction scheduling debugging information",
-  clEnumValN(Sched_NoDebugInfo,      "n", "disable debug output"),
-  clEnumValN(Sched_Disable,        "off", "disable instruction scheduling"),
-  clEnumValN(Sched_PrintMachineCode, "y", "print machine code after scheduling"),
-  clEnumValN(Sched_PrintSchedTrace,  "t", "print trace of scheduling actions"),
-  clEnumValN(Sched_PrintSchedGraphs, "g", "print scheduling graphs"), 0);
+static cl::opt<SchedDebugLevel_t, true>
+SDL_opt("dsched", cl::Hidden, cl::location(SchedDebugLevel),
+        cl::desc("enable instruction scheduling debugging information"),
+        cl::values(
+ clEnumValN(Sched_NoDebugInfo,      "n", "disable debug output"),
+ clEnumValN(Sched_Disable,        "off", "disable instruction scheduling"),
+ clEnumValN(Sched_PrintMachineCode, "y", "print machine code after scheduling"),
+ clEnumValN(Sched_PrintSchedTrace,  "t", "print trace of scheduling actions"),
+ clEnumValN(Sched_PrintSchedGraphs, "g", "print scheduling graphs"),
+                   0));
 
 
 //************************* Internal Data Types *****************************/
index d61feb47979923ef56cb53984f3de8ce548033b3..86e54d0b16582a1c33d1eca7e7bad4f32aad3d7b 100644 (file)
@@ -26,7 +26,6 @@
 #include "llvm/Function.h"
 #include "llvm/iPHINode.h"
 #include "Support/CommandLine.h"
-#include <iostream>
 using std::cerr;
 using std::vector;
 
@@ -40,13 +39,18 @@ enum SelectDebugLevel_t {
   Select_DebugBurgTrees,
 };
 
+
 // Enable Debug Options to be specified on the command line
-cl::Enum<enum SelectDebugLevel_t> SelectDebugLevel("dselect", cl::Hidden,
-   "enable instruction selection debugging information",
+static cl::opt<SelectDebugLevel_t>
+SelectDebugLevel("dselect", cl::Hidden,
+                 cl::desc("enable instruction selection debugging information"),
+                 cl::values(
    clEnumValN(Select_NoDebugInfo,      "n", "disable debug output"),
    clEnumValN(Select_PrintMachineCode, "y", "print generated machine code"),
-   clEnumValN(Select_DebugInstTrees,   "i", "print debugging info for instruction selection "),
-   clEnumValN(Select_DebugBurgTrees,   "b", "print burg trees"), 0);
+   clEnumValN(Select_DebugInstTrees,   "i",
+              "print debugging info for instruction selection"),
+   clEnumValN(Select_DebugBurgTrees,   "b", "print burg trees"),
+                            0));
 
 
 //******************** Forward Function Declarations ***********************/
index ef4156147cb1ccc95cb393331a1f612282d56db7..a192310686dd13f76d01968cf0d65982271b546f 100644 (file)
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/MachineFrameInfo.h"
-#include "llvm/BasicBlock.h"
 #include "llvm/Function.h"
 #include "llvm/Type.h"
 #include "llvm/iOther.h"
 #include "llvm/CodeGen/RegAllocCommon.h"
 #include "Support/CommandLine.h"
 #include "Support/STLExtras.h"
-#include <iostream>
 #include <math.h>
 using std::cerr;
 using std::vector;
 
 RegAllocDebugLevel_t DEBUG_RA;
-static cl::Enum<RegAllocDebugLevel_t> DEBUG_RA_c(DEBUG_RA, "dregalloc",
-                                                 cl::Hidden,
-  "enable register allocation debugging information",
+static cl::opt<RegAllocDebugLevel_t, true>
+DRA_opt("dregalloc", cl::Hidden, cl::location(DEBUG_RA),
+        cl::desc("enable register allocation debugging information"),
+        cl::values(
   clEnumValN(RA_DEBUG_None   , "n", "disable debug output"),
   clEnumValN(RA_DEBUG_Normal , "y", "enable debug output"),
-  clEnumValN(RA_DEBUG_Verbose, "v", "enable extra debug output"), 0);
+  clEnumValN(RA_DEBUG_Verbose, "v", "enable extra debug output"),
+                   0));
 
 
 //----------------------------------------------------------------------------
index 68379f4e168b771b6913bbc133906684d8d630e5..b2eb378b407506ef21cbb1f86f61591ec304ce35 100644 (file)
@@ -24,10 +24,18 @@ using std::vector;
 using std::cout;
 using std::cerr;
 
-cl::Flag   QuietMode ("quiet"  , "Do not emit any non-program output");
-cl::Alias  QuietModeA("q"      , "Alias for -quiet", cl::NoFlags, QuietMode);
-cl::Flag   ArrayChecksEnabled("array-checks", "Enable array bound checks");
-cl::Flag   AbortOnExceptions("abort-on-exception", "Halt execution on a machine exception");
+static cl::opt<bool>
+QuietMode("quiet", cl::desc("Do not emit any non-program output"));
+
+static cl::alias 
+QuietModeA("q", cl::desc("Alias for -quiet"), cl::aliasopt(QuietMode));
+
+static cl::opt<bool>
+ArrayChecksEnabled("array-checks", cl::desc("Enable array bound checks"));
+
+static cl::opt<bool>
+AbortOnExceptions("abort-on-exception",
+                  cl::desc("Halt execution on a machine exception"));
 
 // Create a TargetData structure to handle memory addressing and size/alignment
 // computations
@@ -37,8 +45,9 @@ CachedWriter CW;     // Object to accelerate printing of LLVM
 
 
 #ifdef PROFILE_STRUCTURE_FIELDS
-static cl::Flag ProfileStructureFields("profilestructfields", 
-                                       "Profile Structure Field Accesses");
+static cl::opt<bool>
+ProfileStructureFields("profilestructfields", 
+                       cl::desc("Profile Structure Field Accesses"));
 #include <map>
 static std::map<const StructType *, vector<unsigned> > FieldAccessCounts;
 #endif
index 249955beeb8d8dc0df018ae405cb78577abf0154..a6b2dbdef6abd6bbf36b1c89f02aa4b7d6bb80f4 100644 (file)
 
 bool DebugFlag;  // DebugFlag - Exported boolean set by the -debug option
 
-static cl::Flag Enabled("stats", "Enable statistics output from program");
-static cl::Flag Debug(DebugFlag, "debug", "Enable debug output", cl::Hidden);
+// -stats - Command line option to cause transformations to emit stats about
+// what they did.
+//
+static cl::opt<bool>
+Enabled("stats", cl::desc("Enable statistics output from program"));
+
+// -debug - Command line option to enable the DEBUG statements in the passes.
+static cl::opt<bool, true>
+Debug("debug", cl::desc("Enable debug output"), cl::Hidden,
+      cl::location(DebugFlag));
 
 // Print information when destroyed, iff command line option is specified
 void StatisticBase::destroy() const {
index 6ea37247d0935c30b828b4ec3ab9b722e5776678..1d4c18058f3dc9598d9d29428d7f85bc1da93a1e 100644 (file)
@@ -21,13 +21,16 @@ using std::vector;
 
 SchedDebugLevel_t SchedDebugLevel;
 
-static cl::Enum<enum SchedDebugLevel_t> Opt(SchedDebugLevel,"dsched",cl::Hidden,
-  "enable instruction scheduling debugging information",
-  clEnumValN(Sched_NoDebugInfo,      "n", "disable debug output"),
-  clEnumValN(Sched_Disable,        "off", "disable instruction scheduling"),
-  clEnumValN(Sched_PrintMachineCode, "y", "print machine code after scheduling"),
-  clEnumValN(Sched_PrintSchedTrace,  "t", "print trace of scheduling actions"),
-  clEnumValN(Sched_PrintSchedGraphs, "g", "print scheduling graphs"), 0);
+static cl::opt<SchedDebugLevel_t, true>
+SDL_opt("dsched", cl::Hidden, cl::location(SchedDebugLevel),
+        cl::desc("enable instruction scheduling debugging information"),
+        cl::values(
+ clEnumValN(Sched_NoDebugInfo,      "n", "disable debug output"),
+ clEnumValN(Sched_Disable,        "off", "disable instruction scheduling"),
+ clEnumValN(Sched_PrintMachineCode, "y", "print machine code after scheduling"),
+ clEnumValN(Sched_PrintSchedTrace,  "t", "print trace of scheduling actions"),
+ clEnumValN(Sched_PrintSchedGraphs, "g", "print scheduling graphs"),
+                   0));
 
 
 //************************* Internal Data Types *****************************/
index d61feb47979923ef56cb53984f3de8ce548033b3..86e54d0b16582a1c33d1eca7e7bad4f32aad3d7b 100644 (file)
@@ -26,7 +26,6 @@
 #include "llvm/Function.h"
 #include "llvm/iPHINode.h"
 #include "Support/CommandLine.h"
-#include <iostream>
 using std::cerr;
 using std::vector;
 
@@ -40,13 +39,18 @@ enum SelectDebugLevel_t {
   Select_DebugBurgTrees,
 };
 
+
 // Enable Debug Options to be specified on the command line
-cl::Enum<enum SelectDebugLevel_t> SelectDebugLevel("dselect", cl::Hidden,
-   "enable instruction selection debugging information",
+static cl::opt<SelectDebugLevel_t>
+SelectDebugLevel("dselect", cl::Hidden,
+                 cl::desc("enable instruction selection debugging information"),
+                 cl::values(
    clEnumValN(Select_NoDebugInfo,      "n", "disable debug output"),
    clEnumValN(Select_PrintMachineCode, "y", "print generated machine code"),
-   clEnumValN(Select_DebugInstTrees,   "i", "print debugging info for instruction selection "),
-   clEnumValN(Select_DebugBurgTrees,   "b", "print burg trees"), 0);
+   clEnumValN(Select_DebugInstTrees,   "i",
+              "print debugging info for instruction selection"),
+   clEnumValN(Select_DebugBurgTrees,   "b", "print burg trees"),
+                            0));
 
 
 //******************** Forward Function Declarations ***********************/
index 774bdc7cd7bcfb93124f08bfd74d33d06447a758..b080ec2f3e2db69955ccf48e916dc9aab26dcc41 100644 (file)
@@ -19,12 +19,16 @@ AnalysisID FunctionLiveVarInfo::ID(AnalysisID::create<FunctionLiveVarInfo>());
 
 LiveVarDebugLevel_t DEBUG_LV;
 
-static cl::Enum<LiveVarDebugLevel_t> DEBUG_LV_opt(DEBUG_LV, "dlivevar", cl::Hidden,
-  "enable live-variable debugging information",
-  clEnumValN(LV_DEBUG_None   , "n", "disable debug output"),
-  clEnumValN(LV_DEBUG_Normal , "y", "enable debug output"),
-  clEnumValN(LV_DEBUG_Instr,   "i", "print live-var sets before/after every machine instrn"),
-  clEnumValN(LV_DEBUG_Verbose, "v", "print def, use sets for every instrn also"), 0);
+static cl::opt<LiveVarDebugLevel_t, true>
+DEBUG_LV_opt("dlivevar", cl::Hidden, cl::location(DEBUG_LV),
+             cl::desc("enable live-variable debugging information"),
+             cl::values(
+clEnumValN(LV_DEBUG_None   , "n", "disable debug output"),
+clEnumValN(LV_DEBUG_Normal , "y", "enable debug output"),
+clEnumValN(LV_DEBUG_Instr,   "i", "print live-var sets before/after "
+           "every machine instrn"),
+clEnumValN(LV_DEBUG_Verbose, "v", "print def, use sets for every instrn also"),
+                        0));
 
 
 
index ef4156147cb1ccc95cb393331a1f612282d56db7..a192310686dd13f76d01968cf0d65982271b546f 100644 (file)
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/MachineFrameInfo.h"
-#include "llvm/BasicBlock.h"
 #include "llvm/Function.h"
 #include "llvm/Type.h"
 #include "llvm/iOther.h"
 #include "llvm/CodeGen/RegAllocCommon.h"
 #include "Support/CommandLine.h"
 #include "Support/STLExtras.h"
-#include <iostream>
 #include <math.h>
 using std::cerr;
 using std::vector;
 
 RegAllocDebugLevel_t DEBUG_RA;
-static cl::Enum<RegAllocDebugLevel_t> DEBUG_RA_c(DEBUG_RA, "dregalloc",
-                                                 cl::Hidden,
-  "enable register allocation debugging information",
+static cl::opt<RegAllocDebugLevel_t, true>
+DRA_opt("dregalloc", cl::Hidden, cl::location(DEBUG_RA),
+        cl::desc("enable register allocation debugging information"),
+        cl::values(
   clEnumValN(RA_DEBUG_None   , "n", "disable debug output"),
   clEnumValN(RA_DEBUG_Normal , "y", "enable debug output"),
-  clEnumValN(RA_DEBUG_Verbose, "v", "enable extra debug output"), 0);
+  clEnumValN(RA_DEBUG_Verbose, "v", "enable extra debug output"),
+                   0));
 
 
 //----------------------------------------------------------------------------
index 50f21e23978a74c15cfa49df583dae3ab1a3ac14..eb463b8e1360a1e1907ec1555d7a5ff0104fb0c4 100644 (file)
@@ -52,13 +52,18 @@ enum PtrSize {
   Ptr8bits, Ptr16bits, Ptr32bits
 };
 
-static cl::Enum<enum PtrSize> ReqPointerSize("ptrsize", 0,
-                                      "Set pointer size for -poolalloc pass",
+static cl::opt<PtrSize>
+ReqPointerSize("poolalloc-ptr-size",
+               cl::desc("Set pointer size for -poolalloc pass"),
+               cl::values(
   clEnumValN(Ptr32bits, "32", "Use 32 bit indices for pointers"),
   clEnumValN(Ptr16bits, "16", "Use 16 bit indices for pointers"),
-  clEnumValN(Ptr8bits ,  "8", "Use 8 bit indices for pointers"), 0);
+  clEnumValN(Ptr8bits ,  "8", "Use 8 bit indices for pointers"),
+                          0));
 
-static cl::Flag DisableRLE("no-pool-load-elim", "Disable pool load elimination after poolalloc pass", cl::Hidden);
+static cl::opt<bool>
+DisableRLE("no-pool-load-elim",  cl::Hidden,
+           cl::desc("Disable pool load elimination after poolalloc pass"));
 
 const Type *POINTERTYPE;
 
index 57230c6b77c1355b9601200561b435be3d4c7c2b..3d5ff45ccf2b5b7819f3c181a3d805c0a192435d 100644 (file)
@@ -12,8 +12,6 @@
 #include "llvm/iMemory.h"
 #include "llvm/iTerminators.h"
 #include "llvm/iOther.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Function.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
 #include "llvm/Assembly/Writer.h"
 using std::vector;
 using std::string;
 
-static cl::Flag DisablePtrHashing("tracedisablehashdisable",
-                                  "Disable pointer hashing", cl::NoFlags);
+static cl::opt<bool>
+DisablePtrHashing("tracedisablehashdisable", cl::Hidden,
+                  cl::desc("Disable pointer hashing"));
 
-static cl::StringList TraceFuncName ("tracefunc", "trace only specific funct"
-                                     "ions", cl::NoFlags);
+static cl::list<string>
+TraceFuncName("tracefunc", cl::desc("trace only specific functions"),
+              cl::value_desc("function"));
 
 
 // We trace a particular function if no functions to trace were specified
@@ -37,7 +37,7 @@ static cl::StringList TraceFuncName ("tracefunc", "trace only specific funct"
 inline bool
 TraceThisFunction(Function* func)
 {
-  if (TraceFuncName.getNumOccurances() == 0)
+  if (TraceFuncName.size() == 0)
     return true;
 
   return std::find(TraceFuncName.begin(), TraceFuncName.end(), func->getName())
index 7e27c5f7f0b9b44fbd4f6744407003d0d45d1ea1..b4d1755544adf107dc2e65e84ae43f29a3f2f6fd 100644 (file)
@@ -26,17 +26,24 @@ using std::cerr;
 // raising pass to start at instruction "foo", which is immensely useful for
 // debugging!
 //
-static cl::String StartInst("raise-start-inst", "Start raise pass at the "
-                            "instruction with the specified name", cl::Hidden);
-
-static Statistic<> NumLoadStorePeepholes("raise\t\t- Number of load/store "
-                                         "peepholes");
-static Statistic<> NumGEPInstFormed("raise\t\t- Number of other "
-                                    "getelementptr's formed");
-static Statistic<> NumExprTreesConv("raise\t\t- Number of expression trees"
-                                    " converted");
-static Statistic<> NumCastOfCast("raise\t\t- Number of cast-of-self removed");
-static Statistic<> NumDCEorCP("raise\t\t- Number of insts DCEd or constprop'd");
+static cl::opt<std::string>
+StartInst("raise-start-inst", cl::Hidden, cl::value_desc("inst name"),
+       cl::desc("Start raise pass at the instruction with the specified name"));
+
+static Statistic<>
+NumLoadStorePeepholes("raise\t\t- Number of load/store peepholes");
+
+static Statistic<> 
+NumGEPInstFormed("raise\t\t- Number of other getelementptr's formed");
+
+static Statistic<>
+NumExprTreesConv("raise\t\t- Number of expression trees converted");
+
+static Statistic<>
+NumCastOfCast("raise\t\t- Number of cast-of-self removed");
+
+static Statistic<>
+NumDCEorCP("raise\t\t- Number of insts DCEd or constprop'd");
 
 
 #define PRINT_PEEPHOLE(ID, NUM, I)            \
index db2614e452778550e53abf42a631c0bae832e6d3..4b29371fff847c18e3e582778f57fd46d7bef9df 100644 (file)
@@ -81,8 +81,9 @@ bool PassManager::run(Module &M) { return PM->run(M); }
 // amount of time each pass takes to execute.  This only happens with
 // -time-passes is enabled on the command line.
 //
-static cl::Flag EnableTiming("time-passes", "Time each pass, printing elapsed"
-                             " time for each on exit");
+static cl::opt<bool>
+EnableTiming("time-passes",
+            cl::desc("Time each pass, printing elapsed time for each on exit"));
 
 static double getTime() {
   struct timeval T;
@@ -143,24 +144,28 @@ TimingInfo::~TimingInfo() {
 
 // Different debug levels that can be enabled...
 enum PassDebugLevel {
-  None, PassStructure, PassExecutions, PassDetails
+  None, Structure, Executions, Details
 };
 
-static cl::Enum<enum PassDebugLevel> PassDebugging("debug-pass", cl::Hidden,
-  "Print PassManager debugging information",
-  clEnumVal(None          , "disable debug output"),
-  clEnumVal(PassStructure , "print pass structure before run()"),
-  clEnumVal(PassExecutions, "print pass name before it is executed"),
-  clEnumVal(PassDetails   , "print pass details when it is executed"), 0); 
+static cl::opt<enum PassDebugLevel>
+PassDebugging("debug-pass", cl::Hidden,
+              cl::desc("Print PassManager debugging information"),
+              cl::values(
+  clEnumVal(None      , "disable debug output"),
+  // TODO: add option to print out pass names "PassOptions"
+  clEnumVal(Structure , "print pass structure before run()"),
+  clEnumVal(Executions, "print pass name before it is executed"),
+  clEnumVal(Details   , "print pass details when it is executed"),
+                         0));
 
 void PMDebug::PrintPassStructure(Pass *P) {
-  if (PassDebugging >= PassStructure)
+  if (PassDebugging >= Structure)
     P->dumpPassStructure();
 }
 
 void PMDebug::PrintPassInformation(unsigned Depth, const char *Action,
                                    Pass *P, Annotable *V) {
-  if (PassDebugging >= PassExecutions) {
+  if (PassDebugging >= Executions) {
     std::cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" 
               << P->getPassName();
     if (V) {
@@ -181,7 +186,7 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action,
 
 void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg,
                                    Pass *P, const std::vector<AnalysisID> &Set){
-  if (PassDebugging >= PassDetails && !Set.empty()) {
+  if (PassDebugging >= Details && !Set.empty()) {
     std::cerr << (void*)P << std::string(Depth*2+3, ' ') << Msg << " Analyses:";
     for (unsigned i = 0; i != Set.size(); ++i) {
       Pass *P = Set[i].createPass();   // Good thing this is just debug code...
@@ -192,7 +197,7 @@ void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg,
   }
 }
 
-// dumpPassStructure - Implement the -debug-passes=PassStructure option
+// dumpPassStructure - Implement the -debug-passes=Structure option
 void Pass::dumpPassStructure(unsigned Offset = 0) {
   std::cerr << std::string(Offset*2, ' ') << getPassName() << "\n";
 }
index 249955beeb8d8dc0df018ae405cb78577abf0154..a6b2dbdef6abd6bbf36b1c89f02aa4b7d6bb80f4 100644 (file)
 
 bool DebugFlag;  // DebugFlag - Exported boolean set by the -debug option
 
-static cl::Flag Enabled("stats", "Enable statistics output from program");
-static cl::Flag Debug(DebugFlag, "debug", "Enable debug output", cl::Hidden);
+// -stats - Command line option to cause transformations to emit stats about
+// what they did.
+//
+static cl::opt<bool>
+Enabled("stats", cl::desc("Enable statistics output from program"));
+
+// -debug - Command line option to enable the DEBUG statements in the passes.
+static cl::opt<bool, true>
+Debug("debug", cl::desc("Enable debug output"), cl::Hidden,
+      cl::location(DebugFlag));
 
 // Print information when destroyed, iff command line option is specified
 void StatisticBase::destroy() const {
index 249955beeb8d8dc0df018ae405cb78577abf0154..a6b2dbdef6abd6bbf36b1c89f02aa4b7d6bb80f4 100644 (file)
 
 bool DebugFlag;  // DebugFlag - Exported boolean set by the -debug option
 
-static cl::Flag Enabled("stats", "Enable statistics output from program");
-static cl::Flag Debug(DebugFlag, "debug", "Enable debug output", cl::Hidden);
+// -stats - Command line option to cause transformations to emit stats about
+// what they did.
+//
+static cl::opt<bool>
+Enabled("stats", cl::desc("Enable statistics output from program"));
+
+// -debug - Command line option to enable the DEBUG statements in the passes.
+static cl::opt<bool, true>
+Debug("debug", cl::desc("Enable debug output"), cl::Hidden,
+      cl::location(DebugFlag));
 
 // Print information when destroyed, iff command line option is specified
 void StatisticBase::destroy() const {
index a956203e64910420a617c426b04c11d87a808a6e..c66dd598b9bb8f4f4cab59f367136ad4571be2dd 100644 (file)
 #include <memory>
 using std::cerr;
 
-cl::String InputFilename ("", "Parse <arg> file, compile to bytecode", 0, "-");
-cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "");
-cl::Flag   Force         ("f", "Overwrite output files", cl::NoFlags, false);
-cl::Flag   DumpAsm       ("d", "Print assembly as parsed", cl::Hidden, false);
+static cl::opt<string> 
+InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-"));
+
+static cl::opt<string>
+OutputFilename("o", cl::desc("Override output filename"),
+               cl::value_desc("filename"));
+
+static cl::opt<bool>
+Force("f", cl::desc("Overwrite output files"));
+
+static cl::opt<bool>
+DumpAsm("d", cl::desc("Print assembly as parsed"), cl::Hidden);
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
index eb9a3a39ed067c898027762762a9ec84e910a414..361564c8e54e9674bf8b2e21892df1ea10dfe21b 100644 (file)
@@ -27,13 +27,22 @@ enum OutputMode {
   c,                  // Generate C code
 };
 
-cl::String InputFilename ("", "Load <arg> file, print as assembly", 0, "-");
-cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "");
-cl::Flag   Force         ("f", "Overwrite output files", cl::NoFlags, false);
-cl::EnumFlags<enum OutputMode> WriteMode(cl::NoFlags,
-  clEnumVal(llvm, "Output LLVM assembly"),
-  clEnumVal(c   , "Output C code for program"),
- 0);
+static cl::opt<string>
+InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
+
+static cl::opt<string>
+OutputFilename("o", cl::desc("Override output filename"),
+               cl::value_desc("filename"));
+
+static cl::opt<bool>
+Force("f", cl::desc("Overwrite output files"));
+
+static cl::opt<enum OutputMode>
+WriteMode(cl::desc("Specify the output format:"),
+          cl::values(
+                     clEnumVal(llvm, "Output LLVM assembly"),
+                     clEnumVal(c   , "Output C code for program"),
+                    0));
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm .bc -> .ll disassembler\n");
index d1680c0967482f20e7202334076fe327e07c1174..4730f54250a7413c21ccb9089689792f3aee5477 100644 (file)
 #include "Support/CommandLine.h"
 #include <memory>
 
-static cl::String InputFilename("", "Specify input bytecode file", 0, "-");
-static cl::String ExtractFunc("func", "Specify function to extract", 0, "main");
+// InputFilename - The filename to read from.
+static cl::opt<string>
+InputFilename(cl::Positional, cl::desc("<input bytecode file>"),
+              cl::init("-"), cl::value_desc("filename"));
+              
+
+// ExtractFunc - The function to extract from the module... defaults to main.
+static cl::opt<string>
+ExtractFunc("func", cl::desc("Specify function to extract"), cl::init("main"),
+            cl::value_desc("function"));
+
 
 struct FunctionExtractorPass : public Pass {
   const char *getPassName() const { return "Function Extractor"; }
index 634d08c8510608a49b537e23c1ed101cf91509d1..fbb8f77afc69fe4ffc1efe01b1aa94252a5a1ba8 100644 (file)
 #include <fstream>
 using std::cerr;
 
-static cl::String InputFilename   ("", "Parse <arg> file, compile to bytecode",
-                                   cl::Required, "");
-static cl::String OutputFilename  ("o", "Override output filename");
-static cl::Int    RunNPasses      ("stopAfterNPasses", "Only run the first N "
-                                   "passes of gccas", cl::Hidden);
-static cl::Flag   StopAtLevelRaise("stopraise", "Stop optimization before "
-                                   "level raise", cl::Hidden);
-static cl::Flag   Verify          ("verify", "Verify each pass result");
+static cl::opt<string>
+InputFilename(cl::Positional, cl::desc("<input llvm assembly>"), cl::Required);
+
+static cl::opt<string> 
+OutputFilename("o", cl::desc("Override output filename"),
+               cl::value_desc("filename"));
+
+static cl::opt<int>
+RunNPasses("stopAfterNPasses",
+           cl::desc("Only run the first N passes of gccas"), cl::Hidden,
+           cl::value_desc("# passes"));
+
+static cl::opt<bool> 
+StopAtLevelRaise("stopraise", cl::desc("Stop optimization before level raise"),
+                 cl::Hidden);
+
+static cl::opt<bool>   
+Verify("verify", cl::desc("Verify each pass result"));
+
 
 static inline void addPass(PassManager &PM, Pass *P) {
   static int NumPassesCreated = 0;
index 919884419d415b02e8434736fba5adde1561879a..e5db8849ddcddb41900247a59f8b72d180cb508d 100644 (file)
 #include <sys/stat.h>
 using std::cerr;
 
-cl::StringList InputFilenames("", "Load <arg> files, linking them together", 
-                             cl::OneOrMore);
-cl::String OutputFilename("o", "Override output filename", cl::NoFlags,"a.out");
-cl::Flag   Verbose       ("v", "Print information about actions taken");
-cl::StringList LibPaths  ("L", "Specify a library search path", cl::ZeroOrMore);
-cl::StringList Libraries ("l", "Specify libraries to link to", cl::ZeroOrMore);
-cl::Flag       Strip     ("s", "Strip symbol info from executable");
+static cl::list<string> 
+InputFilenames(cl::Positional, cl::desc("<input bytecode files>"),
+               cl::OneOrMore);
+
+static cl::opt<string> 
+OutputFilename("o", cl::desc("Override output filename"), cl::init("a.out"),
+               cl::value_desc("filename"));
+
+static cl::opt<bool>    
+Verbose("v", cl::desc("Print information about actions taken"));
+
+static cl::list<string> 
+LibPaths("L", cl::desc("Specify a library search path"), cl::Prefix,
+         cl::value_desc("directory"));
+
+static cl::list<string> 
+Libraries("l", cl::desc("Specify libraries to link to"), cl::Prefix,
+          cl::value_desc("library prefix"));
+
+static cl::opt<bool>
+Strip("s", cl::desc("Strip symbol info from executable"));
+
 
 // FileExists - Return true if the specified string is an openable file...
 static inline bool FileExists(const std::string &FN) {
@@ -83,10 +98,7 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
 
 
 int main(int argc, char **argv) {
-  cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n",
-                             cl::EnableSingleLetterArgValue |
-                             cl::DisableSingleLetterArgGrouping);
-  assert(InputFilenames.size() > 0 && "OneOrMore is not working");
+  cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n");
 
   unsigned BaseArg = 0;
   std::string ErrorMessage;
index 28499f19881b5bea9bea0f2e4e7d6cc257d67742..e2ab02e92d0fedf96aa418d1f1ed6862dcb3820e 100644 (file)
 
 using std::cerr;
 
-cl::StringList InputFilenames("", "Load <arg> files, linking them together", 
-                             cl::OneOrMore);
-cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "-");
-cl::Flag   Force         ("f", "Overwrite output files", cl::NoFlags, false);
-cl::Flag   Verbose       ("v", "Print information about actions taken");
-cl::Flag   DumpAsm       ("d", "Print assembly as linked", cl::Hidden, false);
-cl::StringList LibPaths  ("L", "Specify a library search path", cl::ZeroOrMore);
+static cl::list<std::string>
+InputFilenames(cl::Positional, cl::OneOrMore,
+               cl::desc("Load <arg> files, linking them together"));
+
+static cl::opt<std::string>
+OutputFilename("o", cl::desc("Override output filename"), cl::init("-"),
+               cl::value_desc("filename"));
+
+static cl::opt<bool> Force("f", cl::desc("Overwrite output files"));
+
+static cl::opt<bool>
+Verbose("v", cl::desc("Print information about actions taken"));
+
+static cl::opt<bool>
+DumpAsm("d", cl::desc("Print assembly as linked"), cl::Hidden);
+
+static cl::list<std::string>
+LibPaths("L", cl::desc("Specify a library search path"), cl::ZeroOrMore,
+         cl::value_desc("directory"), cl::Prefix);
 
 // FileExists - Return true if the specified string is an openable file...
 static inline bool FileExists(const std::string &FN) {
@@ -74,9 +86,7 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
 
 
 int main(int argc, char **argv) {
-  cl::ParseCommandLineOptions(argc, argv, " llvm linker\n",
-                             cl::EnableSingleLetterArgValue |
-                             cl::DisableSingleLetterArgGrouping);
+  cl::ParseCommandLineOptions(argc, argv, " llvm linker\n");
   assert(InputFilenames.size() > 0 && "OneOrMore is not working");
 
   unsigned BaseArg = 0;
index 3e1dfbcae110c1b8faa87b08ebb4758d0d4ad4db..785f0a624ca4670d8f93ec31ff25f232ac05648c 100644 (file)
 using std::string;
 using std::cerr;
 
-static cl::String InputFilename ("", "Input filename", cl::NoFlags, "-");
-static cl::String OutputFilename("o", "Output filename", cl::NoFlags, "");
-static cl::Flag   Force         ("f", "Overwrite output files");
-static cl::Flag   DumpAsm       ("d", "Print bytecode before native code generation", cl::Hidden);
-static cl::String TraceLibPath  ("tracelibpath", "Path to libinstr for trace code", cl::Hidden, "");
+static cl::opt<string>
+InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
+
+static cl::opt<string>
+OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"));
+
+static cl::opt<bool> Force("f", cl::desc("Overwrite output files"));
+
+static cl::opt<bool>
+DumpAsm("d", cl::desc("Print bytecode before native code generation"),
+        cl::Hidden);
+
+static cl::opt<string>
+TraceLibPath("tracelibpath", cl::desc("Path to libinstr for trace code"),
+             cl::value_desc("directory"), cl::Hidden);
 
 enum TraceLevel {
   TraceOff, TraceFunctions, TraceBasicBlocks
 };
 
-static cl::Enum<enum TraceLevel> TraceValues("trace", cl::NoFlags,
-  "Trace values through functions or basic blocks",
+static cl::opt<TraceLevel>
+TraceValues("trace", cl::desc("Trace values through functions or basic blocks"),
+            cl::values(
   clEnumValN(TraceOff        , "off",        "Disable trace code"),
   clEnumValN(TraceFunctions  , "function",   "Trace each function"),
-  clEnumValN(TraceBasicBlocks, "basicblock", "Trace each basic block"), 0);
-
+  clEnumValN(TraceBasicBlocks, "basicblock", "Trace each basic block"),
+                       0));
 
 // GetFileNameRoot - Helper function to get the basename of a filename...
 static inline string GetFileNameRoot(const string &InputFilename) {
index f4145c169c5cffc03e8e49f9da195ae9ade7d5fe..dc3519454608114c9d14fedb1626d5edd42783b9 100644 (file)
 #include "Interpreter.h"
 #include "Support/CommandLine.h"
 
-cl::StringList InputArgv(""   , "Input command line", cl::ConsumeAfter);
-cl::String MainFunction ("f"      , "Function to execute", cl::NoFlags, "main");
-cl::Flag   DebugMode    ("debug"  , "Start program in debugger");
-cl::Alias  DebugModeA   ("d"      , "Alias for -debug", cl::NoFlags, DebugMode);
-cl::Flag   TraceMode    ("trace"  , "Enable Tracing");
-cl::Flag   ProfileMode  ("profile", "Enable Profiling [unimp]");
+static cl::opt<string>
+InputFile(cl::desc("<input bytecode>"), cl::Positional, cl::init("-"));
+
+static cl::list<std::string>
+InputArgv(cl::ConsumeAfter, cl::desc("<program arguments>..."));
+
+static cl::opt<string>
+MainFunction ("f", cl::desc("Function to execute"), cl::init("main"),
+              cl::value_desc("function name"));
+
+static cl::opt<bool>
+DebugMode("debug", cl::desc("Start program in debugger"));
+
+static cl::alias
+DebugModeA("d", cl::desc("Alias for -debug"), cl::aliasopt(DebugMode));
+
+static cl::opt<bool>
+TraceMode("trace", cl::desc("Enable Tracing"));
+
+static cl::opt<bool>
+ProfileMode("profile", cl::desc("Enable Profiling [unimp]"));
 
 
 //===----------------------------------------------------------------------===//
@@ -24,7 +39,7 @@ cl::Flag   ProfileMode  ("profile", "Enable Profiling [unimp]");
 Interpreter::Interpreter() : ExitCode(0), Profile(ProfileMode), 
                              Trace(TraceMode), CurFrame(-1) {
   CurMod = 0;
-  loadModule(InputArgv.size() ? InputArgv[0] : "-");
+  loadModule(InputFile);
 
   // Initialize the "backend"
   initializeExecutionEngine();
@@ -37,6 +52,12 @@ Interpreter::Interpreter() : ExitCode(0), Profile(ProfileMode),
 int main(int argc, char** argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm interpreter\n");
 
+  // Add the module name to the start of the argv vector...
+  //
+  InputArgv.insert(InputArgv.begin(), InputFile);
+
+
+
   // Create the interpreter...
   Interpreter I;
 
@@ -52,13 +73,6 @@ int main(int argc, char** argv) {
   if (ProfileMode) I.enableProfiling();
   if (TraceMode) I.enableTracing();
 
-  // Ensure that there is at least one argument... the name of the program.
-  // This is only unavailable if the program was read from stdin, instead of a
-  // file.
-  //
-  if (InputArgv.empty())
-    InputArgv.push_back("from-stdin-prog");
-
   // Start interpreter into the main function...
   //
   if (!I.callMainMethod(MainFunction, InputArgv) && !DebugMode) {
index a956203e64910420a617c426b04c11d87a808a6e..c66dd598b9bb8f4f4cab59f367136ad4571be2dd 100644 (file)
 #include <memory>
 using std::cerr;
 
-cl::String InputFilename ("", "Parse <arg> file, compile to bytecode", 0, "-");
-cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "");
-cl::Flag   Force         ("f", "Overwrite output files", cl::NoFlags, false);
-cl::Flag   DumpAsm       ("d", "Print assembly as parsed", cl::Hidden, false);
+static cl::opt<string> 
+InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-"));
+
+static cl::opt<string>
+OutputFilename("o", cl::desc("Override output filename"),
+               cl::value_desc("filename"));
+
+static cl::opt<bool>
+Force("f", cl::desc("Overwrite output files"));
+
+static cl::opt<bool>
+DumpAsm("d", cl::desc("Print assembly as parsed"), cl::Hidden);
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
index a956203e64910420a617c426b04c11d87a808a6e..c66dd598b9bb8f4f4cab59f367136ad4571be2dd 100644 (file)
 #include <memory>
 using std::cerr;
 
-cl::String InputFilename ("", "Parse <arg> file, compile to bytecode", 0, "-");
-cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "");
-cl::Flag   Force         ("f", "Overwrite output files", cl::NoFlags, false);
-cl::Flag   DumpAsm       ("d", "Print assembly as parsed", cl::Hidden, false);
+static cl::opt<string> 
+InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-"));
+
+static cl::opt<string>
+OutputFilename("o", cl::desc("Override output filename"),
+               cl::value_desc("filename"));
+
+static cl::opt<bool>
+Force("f", cl::desc("Overwrite output files"));
+
+static cl::opt<bool>
+DumpAsm("d", cl::desc("Print assembly as parsed"), cl::Hidden);
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
index eb9a3a39ed067c898027762762a9ec84e910a414..361564c8e54e9674bf8b2e21892df1ea10dfe21b 100644 (file)
@@ -27,13 +27,22 @@ enum OutputMode {
   c,                  // Generate C code
 };
 
-cl::String InputFilename ("", "Load <arg> file, print as assembly", 0, "-");
-cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "");
-cl::Flag   Force         ("f", "Overwrite output files", cl::NoFlags, false);
-cl::EnumFlags<enum OutputMode> WriteMode(cl::NoFlags,
-  clEnumVal(llvm, "Output LLVM assembly"),
-  clEnumVal(c   , "Output C code for program"),
- 0);
+static cl::opt<string>
+InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
+
+static cl::opt<string>
+OutputFilename("o", cl::desc("Override output filename"),
+               cl::value_desc("filename"));
+
+static cl::opt<bool>
+Force("f", cl::desc("Overwrite output files"));
+
+static cl::opt<enum OutputMode>
+WriteMode(cl::desc("Specify the output format:"),
+          cl::values(
+                     clEnumVal(llvm, "Output LLVM assembly"),
+                     clEnumVal(c   , "Output C code for program"),
+                    0));
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm .bc -> .ll disassembler\n");
index eb9a3a39ed067c898027762762a9ec84e910a414..361564c8e54e9674bf8b2e21892df1ea10dfe21b 100644 (file)
@@ -27,13 +27,22 @@ enum OutputMode {
   c,                  // Generate C code
 };
 
-cl::String InputFilename ("", "Load <arg> file, print as assembly", 0, "-");
-cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "");
-cl::Flag   Force         ("f", "Overwrite output files", cl::NoFlags, false);
-cl::EnumFlags<enum OutputMode> WriteMode(cl::NoFlags,
-  clEnumVal(llvm, "Output LLVM assembly"),
-  clEnumVal(c   , "Output C code for program"),
- 0);
+static cl::opt<string>
+InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
+
+static cl::opt<string>
+OutputFilename("o", cl::desc("Override output filename"),
+               cl::value_desc("filename"));
+
+static cl::opt<bool>
+Force("f", cl::desc("Overwrite output files"));
+
+static cl::opt<enum OutputMode>
+WriteMode(cl::desc("Specify the output format:"),
+          cl::values(
+                     clEnumVal(llvm, "Output LLVM assembly"),
+                     clEnumVal(c   , "Output C code for program"),
+                    0));
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm .bc -> .ll disassembler\n");
index d1680c0967482f20e7202334076fe327e07c1174..4730f54250a7413c21ccb9089689792f3aee5477 100644 (file)
 #include "Support/CommandLine.h"
 #include <memory>
 
-static cl::String InputFilename("", "Specify input bytecode file", 0, "-");
-static cl::String ExtractFunc("func", "Specify function to extract", 0, "main");
+// InputFilename - The filename to read from.
+static cl::opt<string>
+InputFilename(cl::Positional, cl::desc("<input bytecode file>"),
+              cl::init("-"), cl::value_desc("filename"));
+              
+
+// ExtractFunc - The function to extract from the module... defaults to main.
+static cl::opt<string>
+ExtractFunc("func", cl::desc("Specify function to extract"), cl::init("main"),
+            cl::value_desc("function"));
+
 
 struct FunctionExtractorPass : public Pass {
   const char *getPassName() const { return "Function Extractor"; }
index 28499f19881b5bea9bea0f2e4e7d6cc257d67742..e2ab02e92d0fedf96aa418d1f1ed6862dcb3820e 100644 (file)
 
 using std::cerr;
 
-cl::StringList InputFilenames("", "Load <arg> files, linking them together", 
-                             cl::OneOrMore);
-cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "-");
-cl::Flag   Force         ("f", "Overwrite output files", cl::NoFlags, false);
-cl::Flag   Verbose       ("v", "Print information about actions taken");
-cl::Flag   DumpAsm       ("d", "Print assembly as linked", cl::Hidden, false);
-cl::StringList LibPaths  ("L", "Specify a library search path", cl::ZeroOrMore);
+static cl::list<std::string>
+InputFilenames(cl::Positional, cl::OneOrMore,
+               cl::desc("Load <arg> files, linking them together"));
+
+static cl::opt<std::string>
+OutputFilename("o", cl::desc("Override output filename"), cl::init("-"),
+               cl::value_desc("filename"));
+
+static cl::opt<bool> Force("f", cl::desc("Overwrite output files"));
+
+static cl::opt<bool>
+Verbose("v", cl::desc("Print information about actions taken"));
+
+static cl::opt<bool>
+DumpAsm("d", cl::desc("Print assembly as linked"), cl::Hidden);
+
+static cl::list<std::string>
+LibPaths("L", cl::desc("Specify a library search path"), cl::ZeroOrMore,
+         cl::value_desc("directory"), cl::Prefix);
 
 // FileExists - Return true if the specified string is an openable file...
 static inline bool FileExists(const std::string &FN) {
@@ -74,9 +86,7 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
 
 
 int main(int argc, char **argv) {
-  cl::ParseCommandLineOptions(argc, argv, " llvm linker\n",
-                             cl::EnableSingleLetterArgValue |
-                             cl::DisableSingleLetterArgGrouping);
+  cl::ParseCommandLineOptions(argc, argv, " llvm linker\n");
   assert(InputFilenames.size() > 0 && "OneOrMore is not working");
 
   unsigned BaseArg = 0;
index 609fd2c1e087d609539cafcfc849bfab326cd57b..54eae4103a0b09bb11f17921f8cccf063fb2570d 100644 (file)
@@ -123,13 +123,27 @@ struct {
 
 // Command line option handling code...
 //
-cl::String InputFilename ("", "Load <arg> file to optimize", cl::NoFlags, "-");
-cl::String OutputFilename("o", "Override output filename", cl::NoFlags, "");
-cl::Flag   Force         ("f", "Overwrite output files", cl::NoFlags, false);
-cl::Flag   PrintEachXForm("p", "Print module after each transformation");
-cl::Flag   Quiet         ("q", "Don't print modifying pass names", 0, false);
-cl::Alias  QuietA        ("quiet", "Alias for -q", cl::NoFlags, Quiet);
-cl::EnumList<enum Opts> OptimizationList(cl::NoFlags,
+static cl::opt<string>
+InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
+
+static cl::opt<string>
+OutputFilename("o", cl::desc("Override output filename"),
+               cl::value_desc("filename"));
+
+static cl::opt<bool>
+Force("f", cl::desc("Overwrite output files"));
+
+static cl::opt<bool>
+PrintEachXForm("p", cl::desc("Print module after each transformation"));
+
+static cl::opt<bool>
+Quiet("q", cl::desc("Don't print modifying pass names"));
+
+static cl::alias
+QuietA("quiet", cl::desc("Alias for -q"), cl::aliasopt(Quiet));
+
+static cl::list<enum Opts>
+OptimizationList(cl::desc("Optimizations available:"), cl::values(
   clEnumVal(dce        , "Dead Code Elimination"),
   clEnumVal(die        , "Dead Instruction Elimination"),
   clEnumVal(constprop  , "Simple constant propogation"),
@@ -169,7 +183,7 @@ cl::EnumList<enum Opts> OptimizationList(cl::NoFlags,
   clEnumVal(printm     , "Print working module to stderr"),
   clEnumVal(verify     , "Verify module is well formed"),
   clEnumVal(lowerrefs  , "Decompose multi-dimensional structure/array refs to use one index per instruction"),
-0);
+0));