clang 20.0.0git
|
Constructs a Stack hint for the given symbol. More...
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
Public Member Functions | |
StackHintGeneratorForSymbol (SymbolRef S, StringRef M) | |
~StackHintGeneratorForSymbol () override=default | |
std::string | getMessage (const ExplodedNode *N) override |
Search the call expression for the symbol Sym and dispatch the 'getMessageForX()' methods to construct a specific message. | |
virtual std::string | getMessageForArg (const Expr *ArgE, unsigned ArgIndex) |
Produces the message of the following form: 'Msg via Nth parameter'. | |
virtual std::string | getMessageForReturn (const CallExpr *CallExpr) |
virtual std::string | getMessageForSymbolNotFound () |
Public Member Functions inherited from clang::ento::StackHintGenerator | |
virtual | ~StackHintGenerator ()=0 |
virtual std::string | getMessage (const ExplodedNode *N)=0 |
Construct the Diagnostic message for the given ExplodedNode. | |
Constructs a Stack hint for the given symbol.
The class knows how to construct the stack hint message based on traversing the CallExpr associated with the call and checking if the given symbol is returned or is one of the arguments. The hint can be customized by redefining 'getMessageForX()' methods.
Definition at line 91 of file BugReporter.h.
|
inline |
Definition at line 97 of file BugReporter.h.
|
overridedefault |
|
overridevirtual |
Search the call expression for the symbol Sym and dispatch the 'getMessageForX()' methods to construct a specific message.
Implements clang::ento::StackHintGenerator.
Definition at line 298 of file BugReporter.cpp.
References clang::ento::SVal::getAs(), clang::ento::SVal::getAsLocSymbol(), clang::CallExitEnd::getCalleeContext(), clang::StackFrameContext::getCallSite(), clang::ento::ExplodedNode::getLocation(), getMessageForArg(), getMessageForReturn(), getMessageForSymbolNotFound(), clang::ento::ExplodedNode::getState(), clang::ento::ExplodedNode::getSVal(), and P.
|
virtual |
Produces the message of the following form: 'Msg via Nth parameter'.
Definition at line 344 of file BugReporter.cpp.
Referenced by getMessage().
|
inlinevirtual |
Definition at line 108 of file BugReporter.h.
Referenced by getMessage().
|
inlinevirtual |
Definition at line 112 of file BugReporter.h.
Referenced by getMessage().