]> granicus.if.org Git - clang/commitdiff
Added dump method for global module index.
authorJohn Thompson <John.Thompson.JTSoftware@gmail.com>
Wed, 16 Apr 2014 21:03:41 +0000 (21:03 +0000)
committerJohn Thompson <John.Thompson.JTSoftware@gmail.com>
Wed, 16 Apr 2014 21:03:41 +0000 (21:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206418 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Serialization/GlobalModuleIndex.h
lib/Serialization/GlobalModuleIndex.cpp

index 0d9835a155650dfd3dded8ca9d8d5cedef992529..1f0d7523ec299c260933830c2997eff81691bc06 100644 (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.
index 9ebb0ad5e590f9fcf556d353145de44f19efc73a..3bc7b8fc7292378866bab0b6db312c80c30a67df 100644 (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.
 //----------------------------------------------------------------------------//