mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +00:00 
			
		
		
		
	Using PDL as a prefix for PassDebugLevel enums is not a good idea.
Fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -355,11 +355,6 @@ private: | |||||||
| /// @brief This is the storage for the -time-passes option. | /// @brief This is the storage for the -time-passes option. | ||||||
| extern bool TimePassesIsEnabled; | extern bool TimePassesIsEnabled; | ||||||
|  |  | ||||||
| // Different debug levels that can be enabled... |  | ||||||
| enum PassDebugLevel { |  | ||||||
|   PDLNone, PDLArguments, PDLStructure, PDLExecutions, PDLDetails |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| } // End llvm namespace | } // End llvm namespace | ||||||
|  |  | ||||||
| // Include support files that contain important APIs commonly used by Passes, | // Include support files that contain important APIs commonly used by Passes, | ||||||
|   | |||||||
| @@ -122,7 +122,7 @@ void PMDebug::PrintArgumentInformation(const Pass *P) { | |||||||
|  |  | ||||||
| void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, | void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, | ||||||
|                                    Pass *P, Module *M) { |                                    Pass *P, Module *M) { | ||||||
|   if (PassDebugging >= PDLExecutions) { |   if (PassDebugging >= Executions) { | ||||||
|     cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" |     cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" | ||||||
|          << P->getPassName(); |          << P->getPassName(); | ||||||
|     if (M) cerr << "' on Module '" << M->getModuleIdentifier() << "'\n"; |     if (M) cerr << "' on Module '" << M->getModuleIdentifier() << "'\n"; | ||||||
| @@ -132,7 +132,7 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, | |||||||
|  |  | ||||||
| void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, | void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, | ||||||
|                                    Pass *P, Function *F) { |                                    Pass *P, Function *F) { | ||||||
|   if (PassDebugging >= PDLExecutions) { |   if (PassDebugging >= Executions) { | ||||||
|     cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" |     cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" | ||||||
|          << P->getPassName(); |          << P->getPassName(); | ||||||
|     if (F) cerr << "' on Function '" << F->getName(); |     if (F) cerr << "' on Function '" << F->getName(); | ||||||
| @@ -142,7 +142,7 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, | |||||||
|  |  | ||||||
| void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, | void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, | ||||||
|                                    Pass *P, BasicBlock *BB) { |                                    Pass *P, BasicBlock *BB) { | ||||||
|   if (PassDebugging >= PDLExecutions) { |   if (PassDebugging >= Executions) { | ||||||
|     cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" |     cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" | ||||||
|          << P->getPassName(); |          << P->getPassName(); | ||||||
|     if (BB) cerr << "' on BasicBlock '" << BB->getName(); |     if (BB) cerr << "' on BasicBlock '" << BB->getName(); | ||||||
| @@ -152,7 +152,7 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, | |||||||
|  |  | ||||||
| void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg, | void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg, | ||||||
|                                    Pass *P, const std::vector<AnalysisID> &Set){ |                                    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:"; |     cerr << (void*)P << std::string(Depth*2+3, ' ') << Msg << " Analyses:"; | ||||||
|     for (unsigned i = 0; i != Set.size(); ++i) { |     for (unsigned i = 0; i != Set.size(); ++i) { | ||||||
|       if (i) cerr << ","; |       if (i) cerr << ","; | ||||||
|   | |||||||
| @@ -94,15 +94,20 @@ namespace llvm { | |||||||
| // pass name to be printed before it executes. | // 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> | static cl::opt<enum PassDebugLevel> | ||||||
| PassDebugging_New("debug-pass", cl::Hidden, | PassDebugging_New("debug-pass", cl::Hidden, | ||||||
|                   cl::desc("Print PassManager debugging information"), |                   cl::desc("Print PassManager debugging information"), | ||||||
|                   cl::values( |                   cl::values( | ||||||
|   clEnumVal(PDLNone      , "disable debug output"), |   clEnumVal(None      , "disable debug output"), | ||||||
|   clEnumVal(PDLArguments , "print pass arguments to pass to 'opt'"), |   clEnumVal(Arguments , "print pass arguments to pass to 'opt'"), | ||||||
|   clEnumVal(PDLStructure , "print pass structure before run()"), |   clEnumVal(Structure , "print pass structure before run()"), | ||||||
|   clEnumVal(PDLExecutions, "print pass name before it is executed"), |   clEnumVal(Executions, "print pass name before it is executed"), | ||||||
|   clEnumVal(PDLDetails   , "print pass details when it is executed"), |   clEnumVal(Details   , "print pass details when it is executed"), | ||||||
|                              clEnumValEnd)); |                              clEnumValEnd)); | ||||||
| } // End of llvm namespace | } // End of llvm namespace | ||||||
|  |  | ||||||
| @@ -1264,7 +1269,7 @@ bool PassManagerImpl_New::run(Module &M) { | |||||||
|  |  | ||||||
|   bool Changed = false; |   bool Changed = false; | ||||||
|  |  | ||||||
|   if (PassDebugging_New >= PDLStructure) |   if (PassDebugging_New >= Structure) | ||||||
|     dumpPasses(); |     dumpPasses(); | ||||||
|  |  | ||||||
|   for (std::vector<Pass *>::iterator I = passManagersBegin(), |   for (std::vector<Pass *>::iterator I = passManagersBegin(), | ||||||
|   | |||||||
| @@ -37,15 +37,20 @@ namespace llvm { | |||||||
| // pass name to be printed before it executes. | // 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> | static cl::opt<enum PassDebugLevel> | ||||||
| PassDebugging("debug-pass", cl::Hidden, | PassDebugging("debug-pass", cl::Hidden, | ||||||
|              cl::desc("Print PassManager debugging information"), |              cl::desc("Print PassManager debugging information"), | ||||||
|              cl::values( |              cl::values( | ||||||
|   clEnumVal(PDLNone      , "disable debug output"), |   clEnumVal(None      , "disable debug output"), | ||||||
|   clEnumVal(PDLArguments , "print pass arguments to pass to 'opt'"), |   clEnumVal(Arguments , "print pass arguments to pass to 'opt'"), | ||||||
|   clEnumVal(PDLStructure , "print pass structure before run()"), |   clEnumVal(Structure , "print pass structure before run()"), | ||||||
|   clEnumVal(PDLExecutions, "print pass name before it is executed"), |   clEnumVal(Executions, "print pass name before it is executed"), | ||||||
|   clEnumVal(PDLDetails   , "print pass details when it is executed"), |   clEnumVal(Details   , "print pass details when it is executed"), | ||||||
|                         clEnumValEnd)); |                         clEnumValEnd)); | ||||||
|  |  | ||||||
| //===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||||
| @@ -55,13 +60,13 @@ PassDebugging("debug-pass", cl::Hidden, | |||||||
| struct PMDebug { | struct PMDebug { | ||||||
|   static void PerformPassStartupStuff(Pass *P) { |   static void PerformPassStartupStuff(Pass *P) { | ||||||
|     // If debugging is enabled, print out argument information... |     // If debugging is enabled, print out argument information... | ||||||
|     if (PassDebugging >= PDLArguments) { |     if (PassDebugging >= Arguments) { | ||||||
|       cerr << "Pass Arguments: "; |       cerr << "Pass Arguments: "; | ||||||
|       PrintArgumentInformation(P); |       PrintArgumentInformation(P); | ||||||
|       cerr << "\n"; |       cerr << "\n"; | ||||||
|  |  | ||||||
|       // Print the pass execution structure |       // Print the pass execution structure | ||||||
|       if (PassDebugging >= PDLStructure) |       if (PassDebugging >= Structure) | ||||||
|         P->dumpPassStructure(); |         P->dumpPassStructure(); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| @@ -541,7 +546,7 @@ public: | |||||||
|         cerr << "Analysis '" << (*I)->getPassName() |         cerr << "Analysis '" << (*I)->getPassName() | ||||||
|              << "' used but not available!"; |              << "' used but not available!"; | ||||||
|         assert(0 && "Analysis 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())) |         if ((*I)->getPassName() != std::string(Impl->getPassName())) | ||||||
|           cerr << "    Interface '" << (*I)->getPassName() |           cerr << "    Interface '" << (*I)->getPassName() | ||||||
|                << "' implemented by '" << Impl->getPassName() << "'\n"; |                << "' implemented by '" << Impl->getPassName() << "'\n"; | ||||||
| @@ -630,7 +635,7 @@ private: | |||||||
|         cerr << "Analysis '" << (*I)->getPassName() |         cerr << "Analysis '" << (*I)->getPassName() | ||||||
|              << "' used but not available!"; |              << "' used but not available!"; | ||||||
|         assert(0 && "Analysis 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())) |         if ((*I)->getPassName() != std::string(Impl->getPassName())) | ||||||
|           cerr << "    Interface '" << (*I)->getPassName() |           cerr << "    Interface '" << (*I)->getPassName() | ||||||
|                << "' implemented by '" << Impl->getPassName() << "'\n"; |                << "' implemented by '" << Impl->getPassName() << "'\n"; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user