From: Justin Bogner Date: Fri, 12 Sep 2014 06:52:44 +0000 (+0000) Subject: llvm-cov: Move FunctionCoverageMapping into CoverageMapping.h (NFC) X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8f3096162cbe4d4b2fc7ed23dfdc69565acc7276;p=oota-llvm.git llvm-cov: Move FunctionCoverageMapping into CoverageMapping.h (NFC) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217657 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ProfileData/CoverageMapping.h b/include/llvm/ProfileData/CoverageMapping.h index df33e8885db..144fc521755 100644 --- a/include/llvm/ProfileData/CoverageMapping.h +++ b/include/llvm/ProfileData/CoverageMapping.h @@ -220,6 +220,19 @@ public: ErrorOr 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 Filenames; + /// \brief Regions in the function along with their counts. + std::vector CountedRegions; + + FunctionCoverageMapping(StringRef Name, ArrayRef Filenames) + : Name(Name), Filenames(Filenames.begin(), Filenames.end()) {} +}; + } // end namespace coverage } // end namespace llvm diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp index 9330ea91ce9..3945b17bc3d 100644 --- a/tools/llvm-cov/CodeCoverage.cpp +++ b/tools/llvm-cov/CodeCoverage.cpp @@ -13,7 +13,6 @@ // //===----------------------------------------------------------------------===// -#include "FunctionCoverageMapping.h" #include "RenderingSupport.h" #include "CoverageViewOptions.h" #include "CoverageFilters.h" diff --git a/tools/llvm-cov/CoverageFilters.h b/tools/llvm-cov/CoverageFilters.h index b356377e10f..99ecb791ffc 100644 --- a/tools/llvm-cov/CoverageFilters.h +++ b/tools/llvm-cov/CoverageFilters.h @@ -14,12 +14,14 @@ #ifndef LLVM_COV_COVERAGEFILTERS_H #define LLVM_COV_COVERAGEFILTERS_H -#include "FunctionCoverageMapping.h" +#include "llvm/ProfileData/CoverageMapping.h" #include #include namespace llvm { +using coverage::FunctionCoverageMapping; + /// \brief Matches specific functions that pass the requirement of this filter. class CoverageFilter { public: diff --git a/tools/llvm-cov/CoverageSummary.cpp b/tools/llvm-cov/CoverageSummary.cpp index 62684547d40..c65c5bee00f 100644 --- a/tools/llvm-cov/CoverageSummary.cpp +++ b/tools/llvm-cov/CoverageSummary.cpp @@ -27,8 +27,8 @@ unsigned CoverageSummary::getFileID(StringRef Filename) { return Filenames.size() - 1; } -void -CoverageSummary::createSummaries(ArrayRef Functions) { +void CoverageSummary::createSummaries( + ArrayRef Functions) { std::vector> FunctionFileIDs; FunctionFileIDs.resize(Functions.size()); diff --git a/tools/llvm-cov/CoverageSummary.h b/tools/llvm-cov/CoverageSummary.h index bf4be08d923..5d6a55559cd 100644 --- a/tools/llvm-cov/CoverageSummary.h +++ b/tools/llvm-cov/CoverageSummary.h @@ -30,7 +30,7 @@ class CoverageSummary { unsigned getFileID(StringRef Filename); public: - void createSummaries(ArrayRef Functions); + void createSummaries(ArrayRef Functions); ArrayRef getFileSummaries() { return FileSummaries; } diff --git a/tools/llvm-cov/CoverageSummaryInfo.h b/tools/llvm-cov/CoverageSummaryInfo.h index 710108d1a5d..8a40867b3e1 100644 --- a/tools/llvm-cov/CoverageSummaryInfo.h +++ b/tools/llvm-cov/CoverageSummaryInfo.h @@ -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 index 99fdcff0183..00000000000 --- a/tools/llvm-cov/FunctionCoverageMapping.h +++ /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 -#include -#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 Filenames; - std::vector CountedRegions; - - FunctionCoverageMapping(StringRef Name, ArrayRef Filenames) - : Name(Name), Filenames(Filenames.begin(), Filenames.end()) {} -}; - -} // namespace llvm - -#endif // LLVM_COV_FUNCTIONCOVERAGEMAPPING_H diff --git a/tools/llvm-cov/SourceCoverageDataManager.h b/tools/llvm-cov/SourceCoverageDataManager.h index 1c87266e0c4..abeca192e64 100644 --- a/tools/llvm-cov/SourceCoverageDataManager.h +++ b/tools/llvm-cov/SourceCoverageDataManager.h @@ -14,7 +14,6 @@ #ifndef LLVM_COV_SOURCECOVERAGEDATAMANAGER_H #define LLVM_COV_SOURCECOVERAGEDATAMANAGER_H -#include "FunctionCoverageMapping.h" #include "llvm/ProfileData/CoverageMapping.h" #include