20#include "llvm/Support/raw_ostream.h"
26class TraversalDumper :
public Checker< check::BranchCondition,
28 check::EndFunction > {
36void TraversalDumper::checkBranchCondition(
const Stmt *
Condition,
42 const ParentMap &Parents =
C.getLocationContext()->getParentMap();
50 llvm::outs() <<
C.getSourceManager().getSpellingLineNumber(
Loc) <<
" "
51 <<
Parent->getStmtClassName() <<
"\n";
55 llvm::outs() <<
"--BEGIN FUNCTION--\n";
58void TraversalDumper::checkEndFunction(
const ReturnStmt *RS,
60 llvm::outs() <<
"--END FUNCTION--\n";
67bool ento::shouldRegisterTraversalDumper(
const CheckerManager &mgr) {
74class CallDumper :
public Checker< check::PreCall,
83 unsigned Indentation = 0;
85 LC !=
nullptr; LC = LC->getParent())
91 llvm::outs().indent(Indentation);
92 Call.dump(llvm::outs());
96 const Expr *CallE =
Call.getOriginExpr();
100 unsigned Indentation = 0;
102 LC !=
nullptr; LC = LC->getParent())
108 llvm::outs().indent(Indentation);
109 if (
Call.getResultType()->isVoidType())
110 llvm::outs() <<
"Returning void\n";
112 llvm::outs() <<
"Returning " <<
C.getSVal(CallE) <<
"\n";
Defines the Objective-C statement AST node classes.
This represents one expression.
It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ...
Stmt * getParent(Stmt *) const
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Encodes a location in the source.
Stmt - This represents one statement.
Represents an abstract call to a function or method along a particular path.
CHECKER * registerChecker(AT &&... Args)
Used to register checkers.
The JSON file list parser is used to communicate input to InstallAPI.