diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp --- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -1855,14 +1855,17 @@ /// An error is emitted at line 3. This visitor realizes that the branch /// on line 2 is a control dependency of line 3, and tracks it's condition via /// trackExpressionValue(). -class TrackControlDependencyCondBRVisitor final : public BugReporterVisitor { +class TrackControlDependencyCondBRVisitor final + : public TrackingBugReporterVisitor { const ExplodedNode *Origin; ControlDependencyCalculator ControlDeps; llvm::SmallSet VisitedBlocks; public: - TrackControlDependencyCondBRVisitor(const ExplodedNode *O) - : Origin(O), ControlDeps(&O->getCFG()) {} + TrackControlDependencyCondBRVisitor(TrackerRef ParentTracker, + const ExplodedNode *O) + : TrackingBugReporterVisitor(ParentTracker), Origin(O), + ControlDeps(&O->getCFG()) {} void Profile(llvm::FoldingSetNodeID &ID) const override { static int x = 0; @@ -1960,9 +1963,9 @@ // isn't sufficient, because a new visitor is created for each tracked // expression, hence the BugReport level set. if (BR.addTrackedCondition(N)) { - bugreporter::trackExpressionValue( - N, Condition, BR, bugreporter::TrackingKind::Condition, - /*EnableNullFPSuppression=*/false); + getParentTracker().track(Condition, N, + {bugreporter::TrackingKind::Condition, + /*EnableNullFPSuppression=*/false}); return constructDebugPieceForTrackedCondition(Condition, N, BRC); } } @@ -2078,7 +2081,8 @@ if (LVState->getAnalysisManager() .getAnalyzerOptions() .ShouldTrackConditions) { - Report.addVisitor(InputNode); + Report.addVisitor( + &getParentTracker(), InputNode); Result.FoundSomethingToTrack = true; }