[cfe-commits] r139550 - /cfe/trunk/utils/analyzer/CmpRuns.py

Anna Zaks ganna at apple.com
Mon Sep 12 15:40:36 PDT 2011


Author: zaks
Date: Mon Sep 12 17:40:36 2011
New Revision: 139550

URL: http://llvm.org/viewvc/llvm-project?rev=139550&view=rev
Log:
[analyzer] CmpRuns can now optionally delete empty reports.

Modified:
    cfe/trunk/utils/analyzer/CmpRuns.py

Modified: cfe/trunk/utils/analyzer/CmpRuns.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/CmpRuns.py?rev=139550&r1=139549&r2=139550&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/CmpRuns.py (original)
+++ cfe/trunk/utils/analyzer/CmpRuns.py Mon Sep 12 17:40:36 2011
@@ -90,7 +90,7 @@
             return path[len(self.opts.root):]
         return path
 
-def loadResults(path, opts):
+def loadResults(path, opts, deleteEmpty=True):
     run = AnalysisRun(path, opts)
 
     for f in os.listdir(path):
@@ -101,8 +101,10 @@
         p = os.path.join(path, f)
         data = plistlib.readPlist(p)
 
-        # Ignore empty reports.
+        # Ignore/delete empty reports.
         if not data['files']:
+            if deleteEmpty == True:
+                os.remove(p)
             continue
 
         # Extract the HTML reports, if they exists.
@@ -175,10 +177,10 @@
 
     return res
 
-def cmpScanBuildResults(dirA, dirB, opts):
+def cmpScanBuildResults(dirA, dirB, opts, deleteEmpty=True):
     # Load the run results.
-    resultsA = loadResults(dirA, opts)
-    resultsB = loadResults(dirB, opts)
+    resultsA = loadResults(dirA, opts, deleteEmpty)
+    resultsB = loadResults(dirB, opts, deleteEmpty)
     
     # Open the verbose log, if given.
     if opts.verboseLog:





More information about the cfe-commits mailing list