[llvm] r253877 - SamplePGO - Clear coverage tracking when clearing per-function data.

Diego Novillo via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 08:30:18 PST 2015


Author: dnovillo
Date: Mon Nov 23 10:30:17 2015
New Revision: 253877

URL: http://llvm.org/viewvc/llvm-project?rev=253877&view=rev
Log:
SamplePGO - Clear coverage tracking when clearing per-function data.

Modified:
    llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp

Modified: llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp?rev=253877&r1=253876&r2=253877&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp Mon Nov 23 10:30:17 2015
@@ -188,6 +188,7 @@ public:
   unsigned computeCoverage(unsigned Used, unsigned Total) const;
   unsigned countUsedSamples(const FunctionSamples *Samples) const;
   unsigned countBodySamples(const FunctionSamples *Samples) const;
+  void clear() { SampleCoverage.clear(); }
 
 private:
   typedef DenseMap<LineLocation, unsigned> BodySampleCoverageMap;
@@ -285,6 +286,7 @@ void SampleProfileLoader::clearFunctionD
   LI = nullptr;
   Predecessors.clear();
   Successors.clear();
+  CoverageTracker.clear();
 }
 
 /// \brief Returns the offset of lineno \p L to head_lineno \p H




More information about the llvm-commits mailing list