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,
55 void TraversalDumper::checkBeginFunction(
CheckerContext &C)
const {
56 llvm::outs() <<
"--BEGIN FUNCTION--\n";
59 void TraversalDumper::checkEndFunction(
const ReturnStmt *RS,
61 llvm::outs() <<
"--END FUNCTION--\n";
71 class CallDumper :
public Checker< check::PreCall,
80 unsigned Indentation = 0;
88 llvm::outs().indent(Indentation);
89 Call.
dump(llvm::outs());
97 unsigned Indentation = 0;
105 llvm::outs().indent(Indentation);
107 llvm::outs() <<
"Returning void\n";
109 llvm::outs() <<
"Returning " << C.
getSVal(CallE) <<
"\n";
Stmt - This represents one statement.
Stmt * getParent(Stmt *) const
const Expr * getOriginExpr() const
Returns the expression whose value will be the result of this call.
Defines the Objective-C statement AST node classes.
SVal getSVal(const Stmt *S) const
Get the value of arbitrary expressions at this point in the path.
const char * getStmtClassName() const
const LocationContext * getParent() const
unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
Expr - This represents one expression.
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
ParentMap & getParentMap() const
CHECKER * registerChecker(AT... Args)
Used to register checkers.
Encodes a location in the source.
SourceLocation getLocStart() const LLVM_READONLY
void dump(raw_ostream &Out) const
Dataflow Directional Tag Classes.
Represents an abstract call to a function or method along a particular path.
Represents Objective-C's collection statement.
QualType getResultType() const
Returns the result type, adjusted for references.
SourceManager & getSourceManager()
const LocationContext * getLocationContext() const