21 #include "llvm/Support/raw_ostream.h"
23 using namespace clang;
27 class TraversalDumper :
public Checker< check::BranchCondition,
29 check::EndFunction > {
37 void TraversalDumper::checkBranchCondition(
const Stmt *Condition,
52 << Parent->getStmtClassName() <<
"\n";
55 void TraversalDumper::checkBeginFunction(
CheckerContext &C)
const {
56 llvm::outs() <<
"--BEGIN FUNCTION--\n";
60 llvm::outs() <<
"--END FUNCTION--\n";
70 class CallDumper :
public Checker< check::PreCall,
79 unsigned Indentation = 0;
87 llvm::outs().indent(Indentation);
88 Call.
dump(llvm::outs());
96 unsigned Indentation = 0;
104 llvm::outs().indent(Indentation);
106 llvm::outs() <<
"Returning void\n";
108 llvm::outs() <<
"Returning " << C.
getSVal(CallE) <<
"\n";
unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
Defines the Objective-C statement AST node classes.
const Expr * getOriginExpr() const
Returns the expression whose value will be the result of this call.
Expr - This represents one expression.
ParentMap & getParentMap() const
void dump(raw_ostream &Out) const
CHECKER * registerChecker()
Used to register checkers.
Stmt * getParent(Stmt *) const
Encodes a location in the source.
const LocationContext * getParent() const
Represents an abstract call to a function or method along a particular path.
QualType getResultType() const
Returns the result type, adjusted for references.
Represents Objective-C's collection statement.
SourceManager & getSourceManager()
const LocationContext * getLocationContext() const
SVal getSVal(const Stmt *S) const
Get the value of arbitrary expressions at this point in the path.