Added dump method for global module index.

llvm-svn: 206418
This commit is contained in:
John Thompson 2014-04-16 21:03:41 +00:00
parent 327db80dd5
commit bcdcc92e2f
2 changed files with 18 additions and 0 deletions

View File

@ -186,6 +186,9 @@ public:
/// \brief Print statistics to standard error.
void printStats();
/// \brief Print debugging view to standard error.
void dump();
/// \brief Write a global index into the given
///
/// \param FileMgr The file manager to use to load module files.

View File

@ -349,6 +349,21 @@ void GlobalModuleIndex::printStats() {
std::fprintf(stderr, "\n");
}
void GlobalModuleIndex::dump() {
std::fprintf(stderr, "*** Global Module Index Dump:\n");
std::fprintf(stderr, "Module files:\n");
for (llvm::SmallVector<ModuleInfo, 16>::iterator I = Modules.begin(),
E = Modules.end(); I != E; ++I) {
ModuleInfo *MI = (ModuleInfo*)I;
std::fprintf(stderr, "** %s\n", MI->FileName.c_str());
if (MI->File)
MI->File->dump();
else
std::fprintf(stderr, "\n");
}
std::fprintf(stderr, "\n");
}
//----------------------------------------------------------------------------//
// Global module index writer.
//----------------------------------------------------------------------------//