diff options
| author | Victor Oliveira <Victor.Oliveira@amd.com> | 2012-07-18 19:59:29 +0000 |
|---|---|---|
| committer | Victor Oliveira <Victor.Oliveira@amd.com> | 2012-07-18 19:59:29 +0000 |
| commit | aa9ccee921aa4d14b45b211c202590c6bacc689b (patch) | |
| tree | 2a0cd3dd4527ee63cb7b66203713d899e8133803 | |
| parent | 848094e3ce1593da0cacc75fb3c5c65159ecfea3 (diff) | |
| download | bcm5719-llvm-aa9ccee921aa4d14b45b211c202590c6bacc689b.tar.gz bcm5719-llvm-aa9ccee921aa4d14b45b211c202590c6bacc689b.zip | |
Adding some debug information to PassManager
llvm-svn: 160446
| -rw-r--r-- | llvm/lib/VMCore/PassManager.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/PassManager.cpp b/llvm/lib/VMCore/PassManager.cpp index d4638c57827..4530c0495f1 100644 --- a/llvm/lib/VMCore/PassManager.cpp +++ b/llvm/lib/VMCore/PassManager.cpp @@ -593,6 +593,26 @@ void PMTopLevelManager::schedulePass(Pass *P) { Pass *AnalysisPass = findAnalysisPass(*I); if (!AnalysisPass) { const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I); + + if (PI == NULL) { + // Pass P is not in the global PassRegistry + dbgs() << "Pass '" << P->getPassName() << "' is not initialized." << "\n"; + dbgs() << "Verify if there is a pass dependency cycle." << "\n"; + dbgs() << "Required Passes:" << "\n"; + for (AnalysisUsage::VectorType::const_iterator I2 = RequiredSet.begin(), + E = RequiredSet.end(); I2 != E && I2 != I; ++I2) { + Pass *AnalysisPass2 = findAnalysisPass(*I2); + if (AnalysisPass2) { + dbgs() << "\t" << AnalysisPass2->getPassName() << "\n"; + } + else { + dbgs() << "\t" << "Error: Required pass not found! Possible causes:" << "\n"; + dbgs() << "\t\t" << "- Pass misconfiguration (e.g.: missing macros)" << "\n"; + dbgs() << "\t\t" << "- Corruption of the global PassRegistry" << "\n"; + } + } + } + assert(PI && "Expected required passes to be initialized"); AnalysisPass = PI->createPass(); if (P->getPotentialPassManagerType () == |

