diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-07-01 13:22:02 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-07-01 13:22:02 +0000 |
commit | 9df3605dea17e84f8183581f6103bd0c79e2a606 (patch) | |
tree | 70a2f36ce9eb9bb213603cd7f2f120af53fc176f /include/llvm/ProfileData/Coverage/CoverageMapping.h | |
parent | 08bbd35a80bf7765fe0d3043f9eb5a2f2786b649 (diff) |
Diffstat (limited to 'include/llvm/ProfileData/Coverage/CoverageMapping.h')
-rw-r--r-- | include/llvm/ProfileData/Coverage/CoverageMapping.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/include/llvm/ProfileData/Coverage/CoverageMapping.h b/include/llvm/ProfileData/Coverage/CoverageMapping.h index 0ba792e8dc43c..fa9a87aed6806 100644 --- a/include/llvm/ProfileData/Coverage/CoverageMapping.h +++ b/include/llvm/ProfileData/Coverage/CoverageMapping.h @@ -168,13 +168,21 @@ class CounterExpressionBuilder { /// expression is added to the builder's collection of expressions. Counter get(const CounterExpression &E); + /// Represents a term in a counter expression tree. + struct Term { + unsigned CounterID; + int Factor; + + Term(unsigned CounterID, int Factor) + : CounterID(CounterID), Factor(Factor) {} + }; + /// \brief Gather the terms of the expression tree for processing. /// /// This collects each addition and subtraction referenced by the counter into /// a sequence that can be sorted and combined to build a simplified counter /// expression. - void extractTerms(Counter C, int Sign, - SmallVectorImpl<std::pair<unsigned, int>> &Terms); + void extractTerms(Counter C, int Sign, SmallVectorImpl<Term> &Terms); /// \brief Simplifies the given expression tree /// by getting rid of algebraically redundant operations. @@ -443,20 +451,9 @@ public: /// \brief Load the coverage mapping using the given readers. static Expected<std::unique_ptr<CoverageMapping>> - load(CoverageMappingReader &CoverageReader, - IndexedInstrProfReader &ProfileReader); - - static Expected<std::unique_ptr<CoverageMapping>> load(ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders, IndexedInstrProfReader &ProfileReader); - /// \brief Load the coverage mapping from the given files. - static Expected<std::unique_ptr<CoverageMapping>> - load(StringRef ObjectFilename, StringRef ProfileFilename, - StringRef Arch = StringRef()) { - return load(ArrayRef<StringRef>(ObjectFilename), ProfileFilename, Arch); - } - static Expected<std::unique_ptr<CoverageMapping>> load(ArrayRef<StringRef> ObjectFilenames, StringRef ProfileFilename, StringRef Arch = StringRef()); |