clang  6.0.0svn
Public Member Functions | List of all members
clang::ento::StackHintGeneratorForSymbol Class Reference

Constructs a Stack hint for the given symbol. More...

#include "clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h"

Inheritance diagram for clang::ento::StackHintGeneratorForSymbol:
Inheritance graph
[legend]
Collaboration diagram for clang::ento::StackHintGeneratorForSymbol:
Collaboration graph
[legend]

Public Member Functions

 StackHintGeneratorForSymbol (SymbolRef S, StringRef M)
 
 ~StackHintGeneratorForSymbol () override
 
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. More...
 
virtual std::string getMessageForArg (const Expr *ArgE, unsigned ArgIndex)
 Produces the message of the following form: 'Msg via Nth parameter'. More...
 
virtual std::string getMessageForReturn (const CallExpr *CallExpr)
 
virtual std::string getMessageForSymbolNotFound ()
 
- Public Member Functions inherited from clang::ento::StackHintGenerator
virtual ~StackHintGenerator ()=0
 

Detailed Description

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 477 of file PathDiagnostic.h.

Constructor & Destructor Documentation

◆ StackHintGeneratorForSymbol()

clang::ento::StackHintGeneratorForSymbol::StackHintGeneratorForSymbol ( SymbolRef  S,
StringRef  M 
)
inline

Definition at line 483 of file PathDiagnostic.h.

◆ ~StackHintGeneratorForSymbol()

clang::ento::StackHintGeneratorForSymbol::~StackHintGeneratorForSymbol ( )
inlineoverride

Definition at line 484 of file PathDiagnostic.h.

Member Function Documentation

◆ getMessage()

std::string StackHintGeneratorForSymbol::getMessage ( const ExplodedNode N)
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 1177 of file PathDiagnostic.cpp.

References clang::ProgramPoint::castAs(), clang::CallExitEnd::getCalleeContext(), clang::StackFrameContext::getCallSite(), clang::ento::ExplodedNode::getLocation(), clang::ento::ExplodedNode::getLocationContext(), clang::ento::ExplodedNode::getState(), P, and State.

◆ getMessageForArg()

std::string StackHintGeneratorForSymbol::getMessageForArg ( const Expr ArgE,
unsigned  ArgIndex 
)
virtual

Produces the message of the following form: 'Msg via Nth parameter'.

Definition at line 1224 of file PathDiagnostic.cpp.

◆ getMessageForReturn()

virtual std::string clang::ento::StackHintGeneratorForSymbol::getMessageForReturn ( const CallExpr CallExpr)
inlinevirtual

Definition at line 493 of file PathDiagnostic.h.

◆ getMessageForSymbolNotFound()

virtual std::string clang::ento::StackHintGeneratorForSymbol::getMessageForSymbolNotFound ( )
inlinevirtual

Definition at line 496 of file PathDiagnostic.h.


The documentation for this class was generated from the following files: