SamplePGO - Clear coverage tracking when clearing per-function data.
authorDiego Novillo <dnovillo@google.com>
Mon, 23 Nov 2015 16:30:17 +0000 (16:30 +0000)
committerDiego Novillo <dnovillo@google.com>
Mon, 23 Nov 2015 16:30:17 +0000 (16:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253877 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/SampleProfile.cpp

index 20bfac954a55dcee5ff1a5246805bb8115fed3d1..de4170692fe0a098b775da6e4f21e969abd90972 100644 (file)
@@ -188,6 +188,7 @@ public:
   unsigned computeCoverage(unsigned Used, unsigned Total) const;
   unsigned countUsedSamples(const FunctionSamples *Samples) const;
   unsigned countBodySamples(const FunctionSamples *Samples) const;
   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;
 
 private:
   typedef DenseMap<LineLocation, unsigned> BodySampleCoverageMap;
@@ -285,6 +286,7 @@ void SampleProfileLoader::clearFunctionData() {
   LI = nullptr;
   Predecessors.clear();
   Successors.clear();
   LI = nullptr;
   Predecessors.clear();
   Successors.clear();
+  CoverageTracker.clear();
 }
 
 /// \brief Returns the offset of lineno \p L to head_lineno \p H
 }
 
 /// \brief Returns the offset of lineno \p L to head_lineno \p H