[llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp PassManager.cpp PassManagerT.h

Devang Patel dpatel at apple.com
Wed Dec 13 13:13:48 PST 2006



Changes in directory llvm/lib/VMCore:

Pass.cpp updated: 1.79 -> 1.80
PassManager.cpp updated: 1.94 -> 1.95
PassManagerT.h updated: 1.73 -> 1.74
---
Log message:

Using PDL as a prefix for PassDebugLevel enums is not a good idea.
Fix it.


---
Diffs of the changes:  (+29 -19)

 Pass.cpp        |    8 ++++----
 PassManager.cpp |   17 +++++++++++------
 PassManagerT.h  |   23 ++++++++++++++---------
 3 files changed, 29 insertions(+), 19 deletions(-)


Index: llvm/lib/VMCore/Pass.cpp
diff -u llvm/lib/VMCore/Pass.cpp:1.79 llvm/lib/VMCore/Pass.cpp:1.80
--- llvm/lib/VMCore/Pass.cpp:1.79	Wed Dec 13 14:03:48 2006
+++ llvm/lib/VMCore/Pass.cpp	Wed Dec 13 15:13:31 2006
@@ -122,7 +122,7 @@
 
 void PMDebug::PrintPassInformation(unsigned Depth, const char *Action,
                                    Pass *P, Module *M) {
-  if (PassDebugging >= PDLExecutions) {
+  if (PassDebugging >= Executions) {
     cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '"
          << P->getPassName();
     if (M) cerr << "' on Module '" << M->getModuleIdentifier() << "'\n";
@@ -132,7 +132,7 @@
 
 void PMDebug::PrintPassInformation(unsigned Depth, const char *Action,
                                    Pass *P, Function *F) {
-  if (PassDebugging >= PDLExecutions) {
+  if (PassDebugging >= Executions) {
     cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '"
          << P->getPassName();
     if (F) cerr << "' on Function '" << F->getName();
@@ -142,7 +142,7 @@
 
 void PMDebug::PrintPassInformation(unsigned Depth, const char *Action,
                                    Pass *P, BasicBlock *BB) {
-  if (PassDebugging >= PDLExecutions) {
+  if (PassDebugging >= Executions) {
     cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '"
          << P->getPassName();
     if (BB) cerr << "' on BasicBlock '" << BB->getName();
@@ -152,7 +152,7 @@
 
 void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg,
                                    Pass *P, const std::vector<AnalysisID> &Set){
-  if (PassDebugging >= PDLDetails && !Set.empty()) {
+  if (PassDebugging >= Details && !Set.empty()) {
     cerr << (void*)P << std::string(Depth*2+3, ' ') << Msg << " Analyses:";
     for (unsigned i = 0; i != Set.size(); ++i) {
       if (i) cerr << ",";


Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.94 llvm/lib/VMCore/PassManager.cpp:1.95
--- llvm/lib/VMCore/PassManager.cpp:1.94	Wed Dec 13 14:03:48 2006
+++ llvm/lib/VMCore/PassManager.cpp	Wed Dec 13 15:13:31 2006
@@ -94,15 +94,20 @@
 // pass name to be printed before it executes.
 //
 
+// Different debug levels that can be enabled...
+enum PassDebugLevel {
+  None, Arguments, Structure, Executions, Details
+};
+
 static cl::opt<enum PassDebugLevel>
 PassDebugging_New("debug-pass", cl::Hidden,
                   cl::desc("Print PassManager debugging information"),
                   cl::values(
-  clEnumVal(PDLNone      , "disable debug output"),
-  clEnumVal(PDLArguments , "print pass arguments to pass to 'opt'"),
-  clEnumVal(PDLStructure , "print pass structure before run()"),
-  clEnumVal(PDLExecutions, "print pass name before it is executed"),
-  clEnumVal(PDLDetails   , "print pass details when it is executed"),
+  clEnumVal(None      , "disable debug output"),
+  clEnumVal(Arguments , "print pass arguments to pass to 'opt'"),
+  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"),
                              clEnumValEnd));
 } // End of llvm namespace
 
@@ -1264,7 +1269,7 @@
 
   bool Changed = false;
 
-  if (PassDebugging_New >= PDLStructure)
+  if (PassDebugging_New >= Structure)
     dumpPasses();
 
   for (std::vector<Pass *>::iterator I = passManagersBegin(),


Index: llvm/lib/VMCore/PassManagerT.h
diff -u llvm/lib/VMCore/PassManagerT.h:1.73 llvm/lib/VMCore/PassManagerT.h:1.74
--- llvm/lib/VMCore/PassManagerT.h:1.73	Wed Dec 13 14:03:48 2006
+++ llvm/lib/VMCore/PassManagerT.h	Wed Dec 13 15:13:31 2006
@@ -37,15 +37,20 @@
 // pass name to be printed before it executes.
 //
 
+// Different debug levels that can be enabled...
+enum PassDebugLevel {
+  None, Arguments, Structure, Executions, Details
+};
+
 static cl::opt<enum PassDebugLevel>
 PassDebugging("debug-pass", cl::Hidden,
              cl::desc("Print PassManager debugging information"),
              cl::values(
-  clEnumVal(PDLNone      , "disable debug output"),
-  clEnumVal(PDLArguments , "print pass arguments to pass to 'opt'"),
-  clEnumVal(PDLStructure , "print pass structure before run()"),
-  clEnumVal(PDLExecutions, "print pass name before it is executed"),
-  clEnumVal(PDLDetails   , "print pass details when it is executed"),
+  clEnumVal(None      , "disable debug output"),
+  clEnumVal(Arguments , "print pass arguments to pass to 'opt'"),
+  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"),
                         clEnumValEnd));
 
 //===----------------------------------------------------------------------===//
@@ -55,13 +60,13 @@
 struct PMDebug {
   static void PerformPassStartupStuff(Pass *P) {
     // If debugging is enabled, print out argument information...
-    if (PassDebugging >= PDLArguments) {
+    if (PassDebugging >= Arguments) {
       cerr << "Pass Arguments: ";
       PrintArgumentInformation(P);
       cerr << "\n";
 
       // Print the pass execution structure
-      if (PassDebugging >= PDLStructure)
+      if (PassDebugging >= Structure)
         P->dumpPassStructure();
     }
   }
@@ -541,7 +546,7 @@
         cerr << "Analysis '" << (*I)->getPassName()
              << "' used but not available!";
         assert(0 && "Analysis used but not available!");
-      } else if (PassDebugging == PDLDetails) {
+      } else if (PassDebugging == Details) {
         if ((*I)->getPassName() != std::string(Impl->getPassName()))
           cerr << "    Interface '" << (*I)->getPassName()
                << "' implemented by '" << Impl->getPassName() << "'\n";
@@ -630,7 +635,7 @@
         cerr << "Analysis '" << (*I)->getPassName()
              << "' used but not available!";
         assert(0 && "Analysis used but not available!");
-      } else if (PassDebugging == PDLDetails) {
+      } else if (PassDebugging == Details) {
         if ((*I)->getPassName() != std::string(Impl->getPassName()))
           cerr << "    Interface '" << (*I)->getPassName()
                << "' implemented by '" << Impl->getPassName() << "'\n";






More information about the llvm-commits mailing list