class StackHintGeneratorForSymbol

Declaration

class StackHintGeneratorForSymbol : public StackHintGenerator { /* full declaration omitted */ };

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.

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:91

Inherits from: StackHintGenerator

Member Variables

private clang::ento::SymbolRef Sym
private std::string Msg

Method Overview

Inherited from StackHintGenerator:

Methods

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

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:97

Parameters

clang::ento::SymbolRef S
llvm::StringRef M

std::string getMessage(
    const clang::ento::ExplodedNode* N)

Description

Search the call expression for the symbol Sym and dispatch the 'getMessageForX()' methods to construct a specific message.

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:102

Parameters

const clang::ento::ExplodedNode* N

virtual std::string getMessageForArg(
    const clang::Expr* ArgE,
    unsigned int ArgIndex)

Description

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

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:106

Parameters

const clang::Expr* ArgE
unsigned int ArgIndex

virtual std::string getMessageForReturn(
    const clang::CallExpr* CallExpr)

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:108

Parameters

const clang::CallExpr* CallExpr

virtual std::string getMessageForSymbolNotFound()

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:112

~StackHintGeneratorForSymbol()

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:98