llvm-cov: Move FunctionCoverageMapping into CoverageMapping.h (NFC)
authorJustin Bogner <mail@justinbogner.com>
Fri, 12 Sep 2014 06:52:44 +0000 (06:52 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 12 Sep 2014 06:52:44 +0000 (06:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217657 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ProfileData/CoverageMapping.h
tools/llvm-cov/CodeCoverage.cpp
tools/llvm-cov/CoverageFilters.h
tools/llvm-cov/CoverageSummary.cpp
tools/llvm-cov/CoverageSummary.h
tools/llvm-cov/CoverageSummaryInfo.h
tools/llvm-cov/FunctionCoverageMapping.h [deleted file]
tools/llvm-cov/SourceCoverageDataManager.h

index df33e8885dbf559f9c26e0784fb543090afc6f09..144fc521755da3079a409f19fb3dfb22c9284092 100644 (file)
@@ -220,6 +220,19 @@ public:
   ErrorOr<int64_t> evaluate(const Counter &C) const;
 };
 
+/// \brief Code coverage information for a single function.
+struct FunctionCoverageMapping {
+  /// \brief Raw function name.
+  std::string Name;
+  /// \brief Associated files.
+  std::vector<std::string> Filenames;
+  /// \brief Regions in the function along with their counts.
+  std::vector<CountedRegion> CountedRegions;
+
+  FunctionCoverageMapping(StringRef Name, ArrayRef<StringRef> Filenames)
+      : Name(Name), Filenames(Filenames.begin(), Filenames.end()) {}
+};
+
 } // end namespace coverage
 } // end namespace llvm
 
index 9330ea91ce953a46f77fbfbcba8f106546a9b459..3945b17bc3dbaebe72ddb10dddfb89b7e4c580cf 100644 (file)
@@ -13,7 +13,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "FunctionCoverageMapping.h"
 #include "RenderingSupport.h"
 #include "CoverageViewOptions.h"
 #include "CoverageFilters.h"
index b356377e10fed20ba91a317f97659294e93a25ab..99ecb791ffc5c7e6987b5028003f86fa1766c0dd 100644 (file)
 #ifndef LLVM_COV_COVERAGEFILTERS_H
 #define LLVM_COV_COVERAGEFILTERS_H
 
-#include "FunctionCoverageMapping.h"
+#include "llvm/ProfileData/CoverageMapping.h"
 #include <vector>
 #include <memory>
 
 namespace llvm {
 
+using coverage::FunctionCoverageMapping;
+
 /// \brief Matches specific functions that pass the requirement of this filter.
 class CoverageFilter {
 public:
index 62684547d40dbaef59aa0d440d3258420e4c74bf..c65c5bee00f264b0fa9b362e1eb0fd204c38f446 100644 (file)
@@ -27,8 +27,8 @@ unsigned CoverageSummary::getFileID(StringRef Filename) {
   return Filenames.size() - 1;
 }
 
-void
-CoverageSummary::createSummaries(ArrayRef<FunctionCoverageMapping> Functions) {
+void CoverageSummary::createSummaries(
+    ArrayRef<coverage::FunctionCoverageMapping> Functions) {
   std::vector<std::pair<unsigned, size_t>> FunctionFileIDs;
 
   FunctionFileIDs.resize(Functions.size());
index bf4be08d9236057a10f3149c1fcce982236717c9..5d6a55559cdca5517b516b68be06c6e575257d56 100644 (file)
@@ -30,7 +30,7 @@ class CoverageSummary {
   unsigned getFileID(StringRef Filename);
 
 public:
-  void createSummaries(ArrayRef<FunctionCoverageMapping> Functions);
+  void createSummaries(ArrayRef<coverage::FunctionCoverageMapping> Functions);
 
   ArrayRef<FileCoverageSummary> getFileSummaries() { return FileSummaries; }
 
index 710108d1a5d32d97c933c7170115d7390a06176a..8a40867b3e17fa37bf3e94f2e6cc7142b3265aab 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef LLVM_COV_COVERAGESUMMARYINFO_H
 #define LLVM_COV_COVERAGESUMMARYINFO_H
 
-#include "FunctionCoverageMapping.h"
+#include "llvm/ProfileData/CoverageMapping.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
@@ -100,7 +100,8 @@ struct FunctionCoverageSummary {
 
   /// \brief Compute the code coverage summary for the given function coverage
   /// mapping record.
-  static FunctionCoverageSummary get(const FunctionCoverageMapping &Function);
+  static FunctionCoverageSummary
+  get(const coverage::FunctionCoverageMapping &Function);
 };
 
 /// \brief A summary of file's code coverage.
diff --git a/tools/llvm-cov/FunctionCoverageMapping.h b/tools/llvm-cov/FunctionCoverageMapping.h
deleted file mode 100644 (file)
index 99fdcff..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//===- FunctionCoverageMapping.h - Function coverage mapping record -------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// A structure that stores the coverage mapping record for a single function.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_COV_FUNCTIONCOVERAGEMAPPING_H
-#define LLVM_COV_FUNCTIONCOVERAGEMAPPING_H
-
-#include <string>
-#include <vector>
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/ProfileData/CoverageMapping.h"
-
-namespace llvm {
-
-/// \brief Stores all the required information
-/// about code coverage for a single function.
-struct FunctionCoverageMapping {
-  /// \brief Raw function name.
-  std::string Name;
-  std::vector<std::string> Filenames;
-  std::vector<coverage::CountedRegion> CountedRegions;
-
-  FunctionCoverageMapping(StringRef Name, ArrayRef<StringRef> Filenames)
-      : Name(Name), Filenames(Filenames.begin(), Filenames.end()) {}
-};
-
-} // namespace llvm
-
-#endif // LLVM_COV_FUNCTIONCOVERAGEMAPPING_H
index 1c87266e0c4cc980c396d5afcdb32ffc1fd25ad5..abeca192e646ccc17675788b83c842b3a483beaa 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
 #define LLVM_COV_SOURCECOVERAGEDATAMANAGER_H
 
-#include "FunctionCoverageMapping.h"
 #include "llvm/ProfileData/CoverageMapping.h"
 #include <vector>