Skip to content

[analyzer][NFC] Make CheckerDocumentation checker in-sync with actual checker callbacks #83973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
Original file line number Diff line number Diff line change
Expand Up @@ -1654,6 +1654,10 @@ def StdCLibraryFunctionsTesterChecker : Checker<"StdCLibraryFunctionsTester">,
WeakDependencies<[StdCLibraryFunctionsChecker]>,
Documentation<NotDocumented>;

def CheckerDocumentationChecker : Checker<"CheckerDocumentation">,
HelpText<"Defines an empty checker callback for all possible handlers.">,
Documentation<NotDocumented>;

} // end "debug"


Expand Down
13 changes: 9 additions & 4 deletions clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,7 @@ class CheckerDocumentation : public Checker< check::PreStmt<ReturnStmt>,
/// (2) and (3). Post-call for the allocator is called after step (1).
/// Pre-statement for the new-expression is called on step (4) when the value
/// of the expression is evaluated.
/// \param NE The C++ new-expression that triggered the allocation.
/// \param Target The allocated region, casted to the class type.
void checkNewAllocator(const CXXNewExpr *NE, SVal Target,
CheckerContext &) const {}
void checkNewAllocator(const CXXAllocatorCall &, CheckerContext &) const {}

/// Called on a load from and a store to a location.
///
Expand Down Expand Up @@ -330,5 +327,13 @@ void CheckerDocumentation::checkPostStmt(const DeclStmt *DS,
CheckerContext &C) const {
}

void registerCheckerDocumentationChecker(CheckerManager &Mgr) {
Mgr.registerChecker<CheckerDocumentation>();
}

bool shouldRegisterCheckerDocumentationChecker(const CheckerManager &) {
return false;
}

} // end namespace ento
} // end namespace clang