[analyzer] Add forwarding `addVisitor` method
authorValeriy Savchenko <vsavchenko@apple.com>
Tue, 1 Jun 2021 13:26:53 +0000 (16:26 +0300)
committerValeriy Savchenko <vsavchenko@apple.com>
Thu, 3 Jun 2021 14:10:16 +0000 (17:10 +0300)
commit92d03c20ea71479c78a29da09e377e040d37c3a5
treed379443364e55b00228b593cc10ada4f9ec52f06
parent8fb6c31cbba51b494f232273cdc54dc0788fcd59
[analyzer] Add forwarding `addVisitor` method

The majority of all `addVisitor` callers follow the same pattern:
  addVisitor(std::make_unique<SomeVisitor>(arg1, arg2, ...));

This patches introduces additional overload for `addVisitor` to simplify
that pattern:
  addVisitor<SomeVisitor>(arg1, arg2, ...);

Differential Revision: https://reviews.llvm.org/D103457
clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
clang/lib/StaticAnalyzer/Core/BugReporter.cpp
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp