From: John Thompson Date: Wed, 16 Apr 2014 21:03:41 +0000 (+0000) Subject: Added dump method for global module index. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71a33e5cfcc257fa6a2f3b6db370693e8dd799dd;p=clang Added dump method for global module index. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206418 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Serialization/GlobalModuleIndex.h b/include/clang/Serialization/GlobalModuleIndex.h index 0d9835a155..1f0d7523ec 100644 --- a/include/clang/Serialization/GlobalModuleIndex.h +++ b/include/clang/Serialization/GlobalModuleIndex.h @@ -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. diff --git a/lib/Serialization/GlobalModuleIndex.cpp b/lib/Serialization/GlobalModuleIndex.cpp index 9ebb0ad5e5..3bc7b8fc72 100644 --- a/lib/Serialization/GlobalModuleIndex.cpp +++ b/lib/Serialization/GlobalModuleIndex.cpp @@ -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::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. //----------------------------------------------------------------------------//