20#include "llvm/Support/raw_ostream.h"
30 :
public Checker<check::BeginFunction, check::EndFunction> {
32 void checkBeginFunction(CheckerContext &
C)
const;
33 void checkEndFunction(
const ReturnStmt *RS, CheckerContext &
C)
const;
38 llvm::outs() <<
"--BEGIN FUNCTION--\n";
41void TraversalDumper::checkEndFunction(
const ReturnStmt *RS,
42 CheckerContext &
C)
const {
43 llvm::outs() <<
"--END FUNCTION--\n";
46void ento::registerTraversalDumper(CheckerManager &mgr) {
50bool ento::shouldRegisterTraversalDumper(
const CheckerManager &mgr) {
60class CallDumper :
public Checker< check::PreCall,
63 void checkPreCall(
const CallEvent &
Call, CheckerContext &
C)
const;
64 void checkPostCall(
const CallEvent &
Call, CheckerContext &
C)
const;
68void CallDumper::checkPreCall(
const CallEvent &
Call, CheckerContext &
C)
const {
69 unsigned Indentation = 0;
70 for (
const LocationContext *LC =
C.getLocationContext()->getParent();
71 LC !=
nullptr; LC = LC->getParent())
77 llvm::outs().indent(Indentation);
78 Call.dump(llvm::outs());
81void CallDumper::checkPostCall(
const CallEvent &
Call, CheckerContext &
C)
const {
82 const Expr *CallE =
Call.getOriginExpr();
86 unsigned Indentation = 0;
87 for (
const LocationContext *LC =
C.getLocationContext()->getParent();
88 LC !=
nullptr; LC = LC->getParent())
94 llvm::outs().indent(Indentation);
95 if (
Call.getResultType()->isVoidType())
96 llvm::outs() <<
"Returning void\n";
98 llvm::outs() <<
"Returning " <<
C.getSVal(CallE) <<
"\n";
101void ento::registerCallDumper(CheckerManager &mgr) {
105bool ento::shouldRegisterCallDumper(
const CheckerManager &mgr) {
Defines the Objective-C statement AST node classes.
CHECKER * registerChecker(AT &&...Args)
Register a single-part checker (derived from Checker): construct its singleton instance,...
Simple checker classes that implement one frontend (i.e.
The JSON file list parser is used to communicate input to InstallAPI.