diff options
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()); |