clang: lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

20

21using namespace clang;

22using namespace ento;

23

24

25

26

28namespace ento {

29

30

31

32

33

34

35

38

39 check::ASTCodeBody,

40 check::ASTDecl,

41 check::BeginFunction,

42 check::Bind,

43 check::BranchCondition,

44 check::ConstPointerEscape,

45 check::DeadSymbols,

46 check::EndAnalysis,

47 check::EndFunction,

48 check::EndOfTranslationUnit,

49 check::Event,

50 check::LiveSymbols,

51 check::Location,

52 check::NewAllocator,

53 check::ObjCMessageNil,

54 check::PointerEscape,

55 check::PostCall,

56 check::PostObjCMessage,

57 check::PostStmt,

58 check::PreCall,

59 check::PreObjCMessage,

60 check::PreStmt,

61 check::RegionChanges,

62 eval::Assume,

63 eval::Call

64

65 > {

66public:

67

68

69

70

71

72

73

74

75

76

77

79

80

81

82

83

84

85

86

87

89

90

91

92

93

94

95

96

98

99

100

101

102

104

105

106

107

108

109

110

111

113

114

115

116

117

118

119

120

121

122

123

125

126

127

128

129

131

132

134

135

136

137

138

139

140

141

142

143

144

145

147

148

149

150

151

152

153

154

155

156

159

160

161

162

163

164

165

166

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

184

185

186

187

188

189

191

192

193

194

195

196

198

199

200

201

202

203

204

205

206

207

211

212

213

214

218

219

220

221

222

223

224

225

226

227

228

229

230

231

233

234

235

236

237

238

239

240

241

244 bool Assumption) const { return State; }

245

246

247

248

249

250

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

282 return State;

283 }

284

285

286

287

288

289

290

291

292

293

294

295

296

297

302 return State;

303 }

304

305

306

307

308

313 return State;

314 }

315

316

318

319

320

321

322

323

324

325

326

330

331

332

333

334

337};

338

341}

342

345}

346

348 return false;

349}

350

351}

352}

DeclStmt - Adaptor class for mixing declarations with statements and expressions.

Decl - This represents one declaration (or definition), e.g.

Represents a function declaration or definition.

It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ...

ReturnStmt - This represents a return, optionally of an expression: return; return 4;.

Stmt - This represents one statement.

The top declaration context.

BugReporter is a utility class for generating PathDiagnostics for analysis.

Represents the memory allocation call in a C++ new-expression.

Represents an abstract call to a function or method along a particular path.

This checker documents the callback functions checkers can use to implement the custom handling of th...

void checkNewAllocator(const CXXAllocatorCall &, CheckerContext &) const

Post-visit the C++ operator new's allocation call.

void checkLiveSymbols(ProgramStateRef State, SymbolReaper &SR) const

Allows modifying SymbolReaper object.

void checkEndFunction(const ReturnStmt *RS, CheckerContext &Ctx) const

Called when the analyzer core reaches the end of a function being analyzed regardless of whether it i...

ProgramStateRef evalAssume(ProgramStateRef State, SVal Cond, bool Assumption) const

Handles assumptions on symbolic values.

void checkEndAnalysis(ExplodedGraph &G, BugReporter &BR, ExprEngine &Eng) const

Called after all the paths in the ExplodedGraph reach end of path.

bool evalCall(const CallEvent &Call, CheckerContext &C) const

Evaluates function call.

void checkPostStmt(const DeclStmt *DS, CheckerContext &C) const

Post-visit the Statement.

ProgramStateRef checkRegionChanges(ProgramStateRef State, const InvalidatedSymbols *Invalidated, ArrayRef< const MemRegion * > ExplicitRegions, ArrayRef< const MemRegion * > Regions, const LocationContext *LCtx, const CallEvent *Call) const

Called when the contents of one or more regions change.

ProgramStateRef checkConstPointerEscape(ProgramStateRef State, const InvalidatedSymbols &Escaped, const CallEvent *Call, PointerEscapeKind Kind) const

Called when const pointers escape.

void checkPreObjCMessage(const ObjCMethodCall &M, CheckerContext &C) const

Pre-visit the Objective C message.

void checkBind(SVal Loc, SVal Val, const Stmt *S, CheckerContext &) const

Called on binding of a value to a location.

ProgramStateRef checkPointerEscape(ProgramStateRef State, const InvalidatedSymbols &Escaped, const CallEvent *Call, PointerEscapeKind Kind) const

Called when pointers escape.

void checkPostObjCMessage(const ObjCMethodCall &M, CheckerContext &C) const

Post-visit the Objective C message.

void checkEndOfTranslationUnit(const TranslationUnitDecl *TU, AnalysisManager &Mgr, BugReporter &BR) const

Called after analysis of a TranslationUnit is complete.

void checkPostCall(const CallEvent &Call, CheckerContext &C) const

Post-visit an abstract "call" event.

void checkPreCall(const CallEvent &Call, CheckerContext &C) const

Pre-visit an abstract "call" event.

void checkObjCMessageNil(const ObjCMethodCall &M, CheckerContext &C) const

Visit an Objective-C message whose receiver is nil.

void checkDeadSymbols(SymbolReaper &SR, CheckerContext &C) const

Called whenever a symbol becomes dead.

void checkASTDecl(const FunctionDecl *D, AnalysisManager &Mgr, BugReporter &BR) const

Check every declaration in the AST.

void checkLocation(SVal Loc, bool IsLoad, const Stmt *S, CheckerContext &) const

Called on a load from and a store to a location.

void checkASTCodeBody(const Decl *D, AnalysisManager &Mgr, BugReporter &BR) const

Check every declaration that has a statement body in the AST.

void checkEvent(ImplicitNullDerefEvent Event) const

check::Event

void checkBranchCondition(const Stmt *Condition, CheckerContext &Ctx) const

Pre-visit of the condition statement of a branch (such as IfStmt).

void checkPreStmt(const ReturnStmt *DS, CheckerContext &C) const

Pre-visit the Statement.

void checkBeginFunction(CheckerContext &Ctx) const

Called when the analyzer core starts analyzing a function, regardless of whether it is analyzed at th...

CHECKER * registerChecker(AT &&... Args)

Used to register checkers.

Represents any expression that calls an Objective-C method.

SVal - This represents a symbolic expression, which can be either an L-value or an R-value.

A class responsible for cleaning up unused symbols.

PointerEscapeKind

Describes the different reasons a pointer escapes during analysis.

void registerCheckerDocumentationChecker(CheckerManager &Mgr)

llvm::DenseSet< SymbolRef > InvalidatedSymbols

bool shouldRegisterCheckerDocumentationChecker(const CheckerManager &)

The JSON file list parser is used to communicate input to InstallAPI.

We dereferenced a location that may be null.