Lines Matching refs:Counter
37 /// \brief A region of source code that can be mapped to a counter.
39 Counter Count;
48 SourceMappingRegion(Counter Count, Optional<SourceLocation> LocStart,
52 const Counter &getCounter() const { return Count; }
54 void setCounter(Counter C) { Count = C; }
249 /// \brief Generate the coverage counter mapping regions from collected
345 SourceRegions.emplace_back(Counter(), Start, End);
378 /// \brief Return a counter for the subtraction of \c RHS from \c LHS
379 Counter subtractCounters(Counter LHS, Counter RHS) {
383 /// \brief Return a counter for the sum of \c LHS and \c RHS.
384 Counter addCounters(Counter LHS, Counter RHS) {
388 Counter addCounters(Counter C1, Counter C2, Counter C3) {
392 /// \brief Return the region counter for the given statement.
394 /// This should only be called on statements that have a dedicated counter.
395 Counter getRegionCounter(const Stmt *S) {
396 return Counter::getCounter(CounterMap[S]);
403 size_t pushRegion(Counter Count, Optional<SourceLocation> StartLoc = None,
460 Counter propagateCounts(Counter TopCount, const Stmt *S) {
463 Counter ExitCount = getRegion().getCounter();
528 Optional<Counter> ParentCounter;
583 pushRegion(Counter::getZero());
588 Counter BreakCount;
589 Counter ContinueCount;
667 Counter ParentCount = getRegion().getCounter();
668 Counter BodyCount = getRegionCounter(S);
673 Counter BackedgeCount = propagateCounts(BodyCount, S->getBody());
677 Counter CondCount =
682 Counter OutCount =
691 Counter ParentCount = getRegion().getCounter();
692 Counter BodyCount = getRegionCounter(S);
696 Counter BackedgeCount =
700 Counter CondCount = addCounters(BackedgeCount, BC.ContinueCount);
703 Counter OutCount =
714 Counter ParentCount = getRegion().getCounter();
715 Counter BodyCount = getRegionCounter(S);
720 Counter BackedgeCount = propagateCounts(BodyCount, S->getBody());
729 Counter CondCount =
736 Counter OutCount =
747 Counter ParentCount = getRegion().getCounter();
748 Counter BodyCount = getRegionCounter(S);
752 Counter BackedgeCount = propagateCounts(BodyCount, S->getBody());
755 Counter LoopCount =
757 Counter OutCount =
767 Counter ParentCount = getRegion().getCounter();
768 Counter BodyCount = getRegionCounter(S);
772 Counter BackedgeCount = propagateCounts(BodyCount, S->getBody());
775 Counter LoopCount =
777 Counter OutCount =
798 pushRegion(Counter::getZero(), getStart(CS->body_front()),
805 propagateCounts(Counter::getZero(), Body);
812 Counter ExitCount = getRegionCounter(S);
823 Counter Count = addCounters(Parent.getCounter(), getRegionCounter(S));
845 Counter ParentCount = getRegion().getCounter();
846 Counter ThenCount = getRegionCounter(S);
848 // Emitting a counter for the condition makes it easier to interpret the
849 // counter for the body when looking at the coverage.
853 Counter OutCount = propagateCounts(ThenCount, S->getThen());
855 Counter ElseCount = subtractCounters(ParentCount, ThenCount);
871 Counter ParentCount = getRegion().getCounter();
877 Counter ExitCount = getRegionCounter(S);
888 Counter ParentCount = getRegion().getCounter();
889 Counter TrueCount = getRegionCounter(E);