Author: zaks
Date: Wed Apr  4 21:10:17 2012
New Revision: 154076

URL: http://llvm.org/viewvc/llvm-project?rev=154076&view=rev
Log:
[analyzer] Add a coverage calculation to FunctionSummaries.

Modified:
    cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h

Modified: 
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h?rev=154076&r1=154075&r2=154076&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h 
(original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h 
Wed Apr  4 21:10:17 2012
@@ -87,8 +87,18 @@
     return 0;
   }
 
+  /// Get the percentage of the reachable blocks.
+  unsigned getPercentBlocksReachable(const Decl *D) {
+    MapTy::const_iterator I = Map.find(D);
+      if (I != Map.end())
+        return ((I->second->VisitedBasicBlocks.count() * 100) /
+                 I->second->TotalBasicBlocks);
+    return 0;
+  }
+
   unsigned getTotalNumBasicBlocks();
   unsigned getTotalNumVisitedBasicBlocks();
+
 };
 
 }} // end clang ento namespaces


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to