[CTU] Add missing statistics
authorGabor Marton <gabor.marton@ericsson.com>
Fri, 28 Jun 2019 08:08:51 +0000 (08:08 +0000)
committerGabor Marton <gabor.marton@ericsson.com>
Fri, 28 Jun 2019 08:08:51 +0000 (08:08 +0000)
Reviewers: xazax.hun

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63878

llvm-svn: 364630

clang/lib/CrossTU/CrossTranslationUnit.cpp

index f504082..a532189 100644 (file)
@@ -40,6 +40,10 @@ STATISTIC(
 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 @@ CrossTranslationUnitContext::importDefinitionImpl(const T *D) {
                     [&](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.");