[PATCH] D63878: [CTU] Add missing statistics

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 27 06:55:07 PDT 2019


martong created this revision.
martong added a reviewer: xazax.hun.
Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp, rnkovacs.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63878

Files:
  clang/lib/CrossTU/CrossTranslationUnit.cpp


Index: clang/lib/CrossTU/CrossTranslationUnit.cpp
===================================================================
--- clang/lib/CrossTU/CrossTranslationUnit.cpp
+++ clang/lib/CrossTU/CrossTranslationUnit.cpp
@@ -40,6 +40,10 @@
 STATISTIC(NumGetCTUSuccess,
           "The # of getCTUDefinition successfully returned the "
           "requested function's body");
+STATISTIC(NumUnsupportedNodeFound, "The # of imports when the ASTImporter "
+                                   "encountered an unsupported AST Node");
+STATISTIC(NumNameConflicts, "The # of imports when the ASTImporter "
+                            "encountered an ODR error");
 STATISTIC(NumTripleMismatch, "The # of triple mismatches");
 STATISTIC(NumLangMismatch, "The # of language mismatches");
 STATISTIC(NumLangDialectMismatch, "The # of language dialect mismatches");
@@ -404,10 +408,10 @@
                     [&](const ImportError &IE) {
                       switch (IE.Error) {
                       case ImportError::NameConflict:
-                        // FIXME: Add statistic.
+                        ++NumNameConflicts;
                          break;
                       case ImportError::UnsupportedConstruct:
-                        // FIXME: Add statistic.
+                        ++NumUnsupportedNodeFound;
                         break;
                       case ImportError::Unknown:
                         llvm_unreachable("Unknown import error happened.");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63878.206857.patch
Type: text/x-patch
Size: 1468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190627/5beeade2/attachment.bin>


More information about the cfe-commits mailing list