clang 24.0.0git
CheckerContext.h
Go to the documentation of this file.
1//== CheckerContext.h - Context info for path-sensitive checkers--*- C++ -*--=//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines CheckerContext that provides contextual info for
10// path-sensitive checkers.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_CHECKERCONTEXT_H
15#define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_CHECKERCONTEXT_H
16
19#include <optional>
20
21namespace clang {
22namespace ento {
23
25 ExprEngine &Eng;
26 /// The current exploded(symbolic execution) graph node.
27 ExplodedNode *Pred;
28 /// The flag is true if the (state of the execution) has been modified
29 /// by the checker using this context. For example, a new transition has been
30 /// added or a bug report issued.
31 bool Changed;
32 /// The tagged location, which is used to generate all new nodes.
33 const ProgramPoint Location;
34 /// At the end of the checker evaluation, the analysis will continue from the
35 /// nodes in this set. When the checker adds a transition, freshly created
36 /// non-sink nodes are added to the `Frontier` and the node that was the
37 /// source of the transition is unconditionally removed from the `Frontier`
38 /// (it is superseded, even if the node creation fails or produces a sink).
39 /// At the beginning, the `Frontier` usually contains `Pred`.
40 ExplodedNodeSet &Frontier;
41
42public:
43 /// If we are post visiting a call, this flag will be set if the
44 /// call was inlined. In all other cases it will be false.
45 const bool wasInlined;
46
48 const ProgramPoint &Loc, bool WasInlined = false)
49 : Eng(Eng), Pred(Pred), Changed(false), Location(Loc), Frontier(Dst),
50 wasInlined(WasInlined) {
51 assert(Pred->getState() &&
52 "We should not call the checkers on an empty state.");
53 assert(Loc.getTag() && "The ProgramPoint associated with CheckerContext "
54 "must be tagged with the active checker.");
55 }
56
58 return Eng.getAnalysisManager();
59 }
61 return Eng.getAnalysisManager();
62 }
63
65 return Eng.getConstraintManager();
66 }
68 return Eng.getConstraintManager();
69 }
70
72 return Eng.getStoreManager();
73 }
74 const StoreManager &getStoreManager() const { return Eng.getStoreManager(); }
75
76 /// Returns the previous node in the exploded graph, which includes
77 /// the state of the program before the checker ran. Note, checkers should
78 /// not retain the node in their state since the nodes might get invalidated.
79 ExplodedNode *getPredecessor() const { return Pred; }
80 const ProgramPoint getLocation() const { return Location; }
81 const ProgramStateRef &getState() const { return Pred->getState(); }
82
83 /// Check if the checker changed the state of the execution; ex: added
84 /// a new transition or a bug report.
85 bool isDifferent() const { return Changed; }
86
87 /// Returns the number of times the current block has been visited
88 /// along the analyzed path.
89 unsigned blockCount() const { return Eng.getNumVisitedCurrent(); }
90
92 return Eng.getContext();
93 }
94
95 const ASTContext &getASTContext() const { return Eng.getContext(); }
96
97 const LangOptions &getLangOpts() const {
98 return Eng.getContext().getLangOpts();
99 }
100
101 const StackFrame *getStackFrame() const { return Pred->getStackFrame(); }
102
103 /// Iterates over the current stack frame and all of its ancestors.
104 llvm::iterator_range<StackFrame::parent_iterator> stackframes() const {
106 }
107
108 /// Return true if the current StackFrame has no caller context.
109 bool inTopFrame() const { return getStackFrame()->inTopFrame(); }
110
112 return Eng.getBugReporter();
113 }
114 const BugReporter &getBugReporter() const { return Eng.getBugReporter(); }
115
121 }
122
126 }
127
129 return Eng.getSValBuilder();
130 }
131 const SValBuilder &getSValBuilder() const { return Eng.getSValBuilder(); }
132
138 }
139
141 return Eng.getStateManager();
142 }
144 return Eng.getStateManager();
145 }
146
150
151 /// Get the blockID.
152 unsigned getBlockID() const { return Eng.getCurrBlock()->getBlockID(); }
153
154 /// If the given node corresponds to a PostStore program point,
155 /// retrieve the location region as it was uttered in the code.
156 ///
157 /// This utility can be useful for generating extensive diagnostics, for
158 /// example, for finding variables that the given symbol was assigned to.
160 ProgramPoint L = N->getLocation();
161 if (std::optional<PostStore> PSL = L.getAs<PostStore>())
162 return reinterpret_cast<const MemRegion*>(PSL->getLocationValue());
163 return nullptr;
164 }
165
166 /// Get the value of arbitrary expressions at this point in the path.
167 SVal getSVal(const Expr *E) const { return Pred->getSVal(E); }
168
169 ConstCFGElementRef getCFGElementRef() const { return Eng.getCFGElementRef(); }
170
171 /// Returns true if the value of \p E is greater than or equal to \p
172 /// Val under unsigned comparison.
173 bool isGreaterOrEqual(const Expr *E, unsigned long long Val);
174
175 /// Returns true if the value of \p E is negative.
176 bool isNegative(const Expr *E);
177
178 /// Creates a new ExplodedNode and adds it to the ExplodedGraph as a child of
179 /// 'getPredecessor()', the node that was passed to the constructor of
180 /// CheckerContext.
181 /// Can return nullptr if the node creation fails (when it would recreate
182 /// an existing node or when the state is posteriorly overconstrained).
183 /// Can return 'getPredecessor()' instead of creating a node when the state
184 /// would remain unchanged and there is no explicitly specified tag.
185 ///
186 /// @param State The state of the generated node. Passing nullptr is handled
187 /// as passing 'getState()' (the state of 'getPredecessor()').
188 /// @param Tag A ProgramPointTag that will be attached to the node. This is
189 /// primarily useful for attaching a NoteTag; but another tag could be
190 /// used as a workaround when the node wouldn't be unique otherwise.
191 /// When \p Tag is nullptr, node creation will default to using the
192 /// active checker as the tag -- but if there is no state change,
193 /// the predecessor node may be returned even if it isn't tagged so.
195 const ProgramPointTag *Tag = nullptr) {
196 if ((!State || State == getState()) && !Tag)
197 return getPredecessor();
198 return addTransitionImpl(State, false, nullptr, Tag);
199 }
200
201 /// Creates a new ExplodedNode and adds it to the ExplodedGraph as a child of
202 /// the parameter \p Pred. Allows checkers to make a chain of nodes.
203 /// Can return nullptr if the node creation fails (when it would recreate
204 /// an existing node or when the state is posteriorly overconstrained).
205 ///
206 /// Can return getPredecessor(), the node that was passed to the constructor
207 /// of CheckerContext (often the ancestor of \p Pred) in some corner cases.
208 /// FIXME: This is bad logic and should be fixed in the next non-NFC change.
209 ///
210 /// @param State The state of the generated node.
211 /// @param Pred The node that will become the predecessor of the new node.
212 /// @param Tag A ProgramPointTag that will be attached to the node. This is
213 /// primarily useful for attaching a NoteTag; but another tag could be
214 /// used as a workaround when the node wouldn't be unique otherwise.
215 /// When \p Tag is nullptr, node creation will default to using the
216 /// active checker as the tag.
218 const ProgramPointTag *Tag = nullptr) {
219 // FIXME: In these two early return statements we should use 'Pred' and
220 // 'Pred->getState()' (the node received as an argument and its state)
221 // instead of 'getPredecessor()' and 'getState()' (the older node received
222 // by the constructor of CheckerContext, and its state).
223 // Alternatively, we should perhaps return null if the state is null.
224 if (!State)
225 return getPredecessor();
226 if (State == getState() && !Tag)
227 return getPredecessor();
228 return addTransitionImpl(State, false, Pred, Tag);
229 }
230
231 /// Creates a new ExplodedNode which is marked as a sink and adds it to the
232 /// ExplodedGraph.
233 /// A sink node terminates the execution path: it cannot have children and
234 /// prevents the default behavior that the path "passes through" the checker
235 /// callback without changes if the checker doesn't create any node.
236 /// Can return nullptr if the node creation fails (when it would recreate
237 /// an existing node or when the state is posteriorly overconstrained).
238 ///
239 /// @param State The state of the generated sink node; nullptr (the default)
240 /// means keeping the state of the parent node.
241 /// @param Pred The node that will become the predecessor of the new node;
242 /// nullptr (the default) means the node that was passed to the
243 /// constructor of CheckerContext.
244 /// @param Tag A ProgramPointTag that will be attached to the node; nullptr
245 /// (the default) means using the active checker as the tag. Using
246 /// another tag has no compelling use case (apart from debugging).
248 ExplodedNode *Pred = nullptr,
249 const ProgramPointTag *Tag = nullptr) {
250 return addTransitionImpl(State, true, Pred, Tag);
251 }
252
253 /// Creates a new ExplodedNode and adds it to the ExplodedGraph as a child of
254 /// 'getPredecessor()', the node that was passed to the constructor of
255 /// CheckerContext. The difference between this and 'addTransition' is that
256 /// this always attempts to create a new node, even if there is no state
257 /// change and no explicitly speficified tag.
258 /// Can return nullptr if the node creation fails (when it would recreate
259 /// an existing node or when the state is posteriorly overconstrained).
260 ///
261 /// @param State The state of the generated node. Passing nullptr is handled
262 /// as passing 'getState()' (the state of 'getPredecessor()').
263 /// @param Tag A ProgramPointTag that will be attached to the node. This is
264 /// primarily useful for attaching a NoteTag; but another tag could be
265 /// used as a workaround when the node wouldn't be unique otherwise.
266 /// When \p Tag is nullptr, node creation will default to using the
267 /// active checker as the tag.
270 const ProgramPointTag *Tag = nullptr) {
271 return addTransitionImpl(State, false, nullptr, Tag);
272 }
273
274 /// Creates a new ExplodedNode and adds it to the ExplodedGraph as a child of
275 /// the parameter \p Pred. Allows checkers to make a chain of nodes.
276 /// The difference between this and 'addTransition()' should be that this
277 /// always attempts to create a new node (even if there is no state change
278 /// and no explicitly specified tag). Currently this logic is incorrect in
279 /// addTransition and the difference is that this function lacks one of the
280 /// two problematic early return statements.
281 /// Can return nullptr if the node creation fails (when it would recreate
282 /// an existing node or when the state is posteriorly overconstrained).
283 ///
284 /// @param State The state of the generated node.
285 /// @param Pred The node that will become the predecessor of the new node.
286 /// @param Tag A ProgramPointTag that will be attached to the node. This is
287 /// primarily useful for attaching a NoteTag; but another tag could be
288 /// used as a workaround when the node wouldn't be unique otherwise.
289 /// When \p Tag is nullptr, node creation will default to using the
290 /// active checker as the tag.
293 ExplodedNode *Pred,
294 const ProgramPointTag *Tag = nullptr) {
295 // FIXME: This can "jump back" to an ancestor of 'Pred'. We should return
296 // either Pred or nullptr in this case.
297 if (!State)
298 return getPredecessor();
299 return addTransitionImpl(State, false, Pred, Tag);
300 }
301
302 /// Emit the diagnostics report.
303 void emitReport(std::unique_ptr<BugReport> R) {
304 Changed = true;
305 Eng.getBugReporter().emitReport(std::move(R));
306 }
307
308 /// Produce a program point tag that displays an additional path note
309 /// to the user. This is a lightweight alternative to the
310 /// BugReporterVisitor mechanism: instead of visiting the bug report
311 /// node-by-node to restore the sequence of events that led to discovering
312 /// a bug, you can add notes as you add your transitions.
313 ///
314 /// @param Cb Callback with 'BugReporterContext &, BugReport &' parameters.
315 /// @param IsPrunable Whether the note is prunable. It allows BugReporter
316 /// to omit the note from the report if it would make the displayed
317 /// bug path significantly shorter.
318 LLVM_ATTRIBUTE_RETURNS_NONNULL
319 const NoteTag *getNoteTag(NoteTag::Callback &&Cb, bool IsPrunable = false) {
320 return Eng.getDataTags().make<NoteTag>(std::move(Cb), IsPrunable);
321 }
322
323 /// A shorthand version of getNoteTag that doesn't require you to accept
324 /// the 'BugReporterContext' argument when you don't need it.
325 ///
326 /// @param Cb Callback only with 'BugReport &' parameter.
327 /// @param IsPrunable Whether the note is prunable. It allows BugReporter
328 /// to omit the note from the report if it would make the displayed
329 /// bug path significantly shorter.
330 const NoteTag
332 bool IsPrunable = false) {
333 return getNoteTag(
334 [Cb](BugReporterContext &,
335 PathSensitiveBugReport &BR) { return Cb(BR); },
336 IsPrunable);
337 }
338
339 /// A shorthand version of getNoteTag that doesn't require you to accept
340 /// the arguments when you don't need it.
341 ///
342 /// @param Cb Callback without parameters.
343 /// @param IsPrunable Whether the note is prunable. It allows BugReporter
344 /// to omit the note from the report if it would make the displayed
345 /// bug path significantly shorter.
346 const NoteTag *getNoteTag(std::function<std::string()> &&Cb,
347 bool IsPrunable = false) {
348 return getNoteTag([Cb](BugReporterContext &,
349 PathSensitiveBugReport &) { return Cb(); },
350 IsPrunable);
351 }
352
353 /// A shorthand version of getNoteTag that accepts a plain note.
354 ///
355 /// @param Note The note.
356 /// @param IsPrunable Whether the note is prunable. It allows BugReporter
357 /// to omit the note from the report if it would make the displayed
358 /// bug path significantly shorter.
359 const NoteTag *getNoteTag(StringRef Note, bool IsPrunable = false) {
360 return getNoteTag(
361 [Note = std::string(Note)](BugReporterContext &,
362 PathSensitiveBugReport &) { return Note; },
363 IsPrunable);
364 }
365
366 /// A shorthand version of getNoteTag that accepts a lambda with stream for
367 /// note.
368 ///
369 /// @param Cb Callback with 'BugReport &' and 'llvm::raw_ostream &'.
370 /// @param IsPrunable Whether the note is prunable. It allows BugReporter
371 /// to omit the note from the report if it would make the displayed
372 /// bug path significantly shorter.
374 std::function<void(PathSensitiveBugReport &BR, llvm::raw_ostream &OS)> &&Cb,
375 bool IsPrunable = false) {
376 return getNoteTag(
377 [Cb](PathSensitiveBugReport &BR) -> std::string {
379 llvm::raw_svector_ostream OS(Str);
380 Cb(BR, OS);
381 return std::string(OS.str());
382 },
383 IsPrunable);
384 }
385
386 /// Returns the word that should be used to refer to the declaration
387 /// in the report.
388 StringRef getDeclDescription(const Decl *D);
389
390 /// Get the declaration of the called function (path-sensitive).
391 const FunctionDecl *getCalleeDecl(const CallExpr *CE) const;
392
393 /// Get the name of the called function (path-sensitive).
394 StringRef getCalleeName(const FunctionDecl *FunDecl) const;
395
396 /// Get the identifier of the called function (path-sensitive).
398 const FunctionDecl *FunDecl = getCalleeDecl(CE);
399 if (FunDecl)
400 return FunDecl->getIdentifier();
401 else
402 return nullptr;
403 }
404
405 /// Get the name of the called function (path-sensitive).
406 StringRef getCalleeName(const CallExpr *CE) const {
407 const FunctionDecl *FunDecl = getCalleeDecl(CE);
408 return getCalleeName(FunDecl);
409 }
410
411 /// Returns true if the given function is an externally-visible function in
412 /// the top-level namespace, such as \c malloc.
413 ///
414 /// If a name is provided, the function must additionally match the given
415 /// name.
416 ///
417 /// Note that this also accepts functions from the \c std namespace (because
418 /// headers like <cstdlib> declare them there) and does not check if the
419 /// function is declared as 'extern "C"' or if it uses C++ name mangling.
420 static bool isCLibraryFunction(const FunctionDecl *FD,
421 StringRef Name = StringRef());
422
423 /// In builds that use source hardening (-D_FORTIFY_SOURCE), many standard
424 /// functions are implemented as macros that expand to calls of hardened
425 /// functions that take additional arguments compared to the "usual"
426 /// variant and perform additional input validation. For example, a `memcpy`
427 /// call may expand to `__memcpy_chk()` or `__builtin___memcpy_chk()`.
428 ///
429 /// This method returns true if `FD` declares a fortified variant of the
430 /// standard library function `Name`.
431 ///
432 /// NOTE: This method relies on heuristics; extend it if you need to handle a
433 /// hardened variant that's not yet covered by it.
434 static bool isHardenedVariantOf(const FunctionDecl *FD, StringRef Name);
435
436 /// Depending on whether the location corresponds to a macro, return
437 /// either the macro name or the token spelling.
438 ///
439 /// This could be useful when checkers' logic depends on whether a function
440 /// is called with a given macro argument. For example:
441 /// s = socket(AF_INET,..)
442 /// If AF_INET is a macro, the result should be treated as a source of taint.
443 ///
444 /// \sa clang::Lexer::getSpelling(), clang::Lexer::getImmediateMacroName().
446
447private:
448 ExplodedNode *addTransitionImpl(ProgramStateRef State, bool MarkAsSink,
449 ExplodedNode *P, const ProgramPointTag *Tag) {
450 Changed = true;
451 const ProgramPoint &LocalLoc = (Tag ? Location.withTag(Tag) : Location);
452
453 if (!P)
454 P = getPredecessor();
455 if (!State)
456 State = P->getState();
457
458 Frontier.erase(P);
459 ExplodedNode *N =
460 Eng.getCoreEngine().makeNode(LocalLoc, State, P, MarkAsSink);
461
462 Frontier.insert(N);
463 return N;
464 }
465};
466
467} // end GR namespace
468
469} // end clang namespace
470
471#endif
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:245
AnalysisDeclContext contains the context data for the function, method or block under analysis.
const StackFrame * getStackFrame(const StackFrame *ParentSF, const void *Data, const Expr *E, const CFGBlock *Blk, unsigned BlockCount, unsigned Index)
Obtain a context of the call stack using its parent context.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:3012
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
This represents one expression.
Definition Expr.h:114
Represents a function declaration or definition.
Definition Decl.h:2071
One of these records is kept for each identifier that is lexed.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Definition Decl.h:297
Represents a program point after a store evaluation.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
ProgramPoints can be "tagged" as representing points specific to a given analysis entity.
std::optional< T > getAs() const
Convert to the specified ProgramPoint type, returning std::nullopt if this ProgramPoint is not of the...
Encodes a location in the source.
This class handles loading and caching of source files into memory.
It represents a stack frame of the call stack.
LLVM_ATTRIBUTE_RETURNS_NONNULL AnalysisDeclContext * getAnalysisDeclContext() const
llvm::iterator_range< parent_iterator > parentsIncludingSelf() const
Iterates over this frame followed by all of its ancestors.
BugReporter is a utility class for generating PathDiagnostics for analysis.
Preprocessor & getPreprocessor()
const SourceManager & getSourceManager()
const IdentifierInfo * getCalleeIdentifier(const CallExpr *CE) const
Get the identifier of the called function (path-sensitive).
CheckerContext(ExprEngine &Eng, ExplodedNode *Pred, ExplodedNodeSet &Dst, const ProgramPoint &Loc, bool WasInlined=false)
static const MemRegion * getLocationRegionIfPostStore(const ExplodedNode *N)
If the given node corresponds to a PostStore program point, retrieve the location region as it was ut...
SymbolManager & getSymbolManager()
StringRef getDeclDescription(const Decl *D)
Returns the word that should be used to refer to the declaration in the report.
Preprocessor & getPreprocessor()
SVal getSVal(const Expr *E) const
Get the value of arbitrary expressions at this point in the path.
unsigned blockCount() const
Returns the number of times the current block has been visited along the analyzed path.
ExplodedNode * addSink(ProgramStateRef State=nullptr, ExplodedNode *Pred=nullptr, const ProgramPointTag *Tag=nullptr)
Creates a new ExplodedNode which is marked as a sink and adds it to the ExplodedGraph.
const SourceManager & getSourceManager()
const NoteTag * getNoteTag(std::function< std::string()> &&Cb, bool IsPrunable=false)
A shorthand version of getNoteTag that doesn't require you to accept the arguments when you don't nee...
llvm::iterator_range< StackFrame::parent_iterator > stackframes() const
Iterates over the current stack frame and all of its ancestors.
StringRef getCalleeName(const FunctionDecl *FunDecl) const
Get the name of the called function (path-sensitive).
const NoteTag * getNoteTag(StringRef Note, bool IsPrunable=false)
A shorthand version of getNoteTag that accepts a plain note.
const SourceManager & getSourceManager() const
std::string getMacroNameOrSpelling(SourceLocation &Loc)
Depending on whether the location corresponds to a macro, return either the macro name or the token s...
StringRef getCalleeName(const CallExpr *CE) const
Get the name of the called function (path-sensitive).
const ProgramStateRef & getState() const
ExplodedNode * addTransition(ProgramStateRef State=nullptr, const ProgramPointTag *Tag=nullptr)
Creates a new ExplodedNode and adds it to the ExplodedGraph as a child of 'getPredecessor()',...
ConstraintManager & getConstraintManager()
ExplodedNode * addTransition(ProgramStateRef State, ExplodedNode *Pred, const ProgramPointTag *Tag=nullptr)
Creates a new ExplodedNode and adds it to the ExplodedGraph as a child of the parameter Pred.
bool isNegative(const Expr *E)
Returns true if the value of E is negative.
const Preprocessor & getPreprocessor() const
const SValBuilder & getSValBuilder() const
AnalysisDeclContext * getCurrentAnalysisDeclContext() const
ExplodedNode * getPredecessor() const
Returns the previous node in the exploded graph, which includes the state of the program before the c...
bool isGreaterOrEqual(const Expr *E, unsigned long long Val)
Returns true if the value of E is greater than or equal to Val under unsigned comparison.
const ProgramPoint getLocation() const
static bool isCLibraryFunction(const FunctionDecl *FD, StringRef Name=StringRef())
Returns true if the given function is an externally-visible function in the top-level namespace,...
ExplodedNode * generateNonFatalErrorNode(ProgramStateRef State=nullptr, const ProgramPointTag *Tag=nullptr)
Creates a new ExplodedNode and adds it to the ExplodedGraph as a child of 'getPredecessor()',...
LLVM_ATTRIBUTE_RETURNS_NONNULL const NoteTag * getNoteTag(NoteTag::Callback &&Cb, bool IsPrunable=false)
Produce a program point tag that displays an additional path note to the user.
const ASTContext & getASTContext() const
ConstCFGElementRef getCFGElementRef() const
AnalysisManager & getAnalysisManager()
const FunctionDecl * getCalleeDecl(const CallExpr *CE) const
Get the declaration of the called function (path-sensitive).
const SymbolManager & getSymbolManager() const
const NoteTag * getNoteTag(std::function< void(PathSensitiveBugReport &BR, llvm::raw_ostream &OS)> &&Cb, bool IsPrunable=false)
A shorthand version of getNoteTag that accepts a lambda with stream for note.
ProgramStateManager & getStateManager()
const ProgramStateManager & getStateManager() const
const StoreManager & getStoreManager() const
const LangOptions & getLangOpts() const
const BugReporter & getBugReporter() const
bool inTopFrame() const
Return true if the current StackFrame has no caller context.
const ConstraintManager & getConstraintManager() const
const bool wasInlined
If we are post visiting a call, this flag will be set if the call was inlined.
ExplodedNode * generateNonFatalErrorNode(ProgramStateRef State, ExplodedNode *Pred, const ProgramPointTag *Tag=nullptr)
Creates a new ExplodedNode and adds it to the ExplodedGraph as a child of the parameter Pred.
StoreManager & getStoreManager()
const NoteTag * getNoteTag(std::function< std::string(PathSensitiveBugReport &)> &&Cb, bool IsPrunable=false)
A shorthand version of getNoteTag that doesn't require you to accept the 'BugReporterContext' argumen...
const AnalysisManager & getAnalysisManager() const
static bool isHardenedVariantOf(const FunctionDecl *FD, StringRef Name)
In builds that use source hardening (-D_FORTIFY_SOURCE), many standard functions are implemented as m...
void emitReport(std::unique_ptr< BugReport > R)
Emit the diagnostics report.
bool isDifferent() const
Check if the checker changed the state of the execution; ex: added a new transition or a bug report.
const StackFrame * getStackFrame() const
unsigned getBlockID() const
Get the blockID.
ExplodedNode * makeNode(const ProgramPoint &Loc, ProgramStateRef State, ExplodedNode *Pred, bool MarkAsSink=false) const
ExplodedNodeSet is a set of ExplodedNode * elements with the invariant that its elements cannot be nu...
void insert(ExplodedNode *N)
bool erase(ExplodedNode *N)
const ProgramStateRef & getState() const
ProgramPoint getLocation() const
getLocation - Returns the edge associated with the given node.
const CoreEngine & getCoreEngine() const
Definition ExprEngine.h:472
MemRegion - The root abstract class for all memory regions.
Definition MemRegion.h:97
The tag upon which the TagVisitor reacts.
std::function< std::string(BugReporterContext &, PathSensitiveBugReport &)> Callback
SymbolManager & getSymbolManager()
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
Definition SVals.h:57
IntrusiveRefCntPtr< const ProgramState > ProgramStateRef
@ OS
Indicates that the tracking object is a descendant of a referenced-counted OSObject,...
Top level wrappers for InstallAPI frontend operations.
CFGBlock::ConstCFGElementRef ConstCFGElementRef
Definition CFG.h:1271
int const char * function
Definition c++config.h:31
#define false
Definition stdbool.h:26