clang 8.0.0

Public Member Functions | Static Public Member Functions | List of all members
clang::ento::PathDiagnosticEventPiece Class Reference

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

Inheritance diagram for clang::ento::PathDiagnosticEventPiece:
[legend]
Collaboration diagram for clang::ento::PathDiagnosticEventPiece:
[legend]

## Public Member Functions
| PathDiagnosticEventPiece (const PathDiagnosticLocation &pos, StringRef s, bool addPosRange=true, StackHintGenerator *stackHint=nullptr)
| ~PathDiagnosticEventPiece () override
void | setPrunable (bool isPrunable, bool override=false)
| Mark the diagnostic piece as being potentially prunable. More...
bool | isPrunable () const
| Return true if the diagnostic piece is prunable. More...
bool | hasCallStackHint ()
std::string | getCallStackMessage (const ExplodedNode *N)
| Produce the hint for the given node. More...
void | dump () const override
Public Member Functions inherited from clang::ento::PathDiagnosticSpotPiece
| PathDiagnosticSpotPiece (const PathDiagnosticLocation &pos, StringRef s, PathDiagnosticPiece::Kind k, bool addPosRange=true)
PathDiagnosticLocation | getLocation () const override
void | flattenLocations () override
void | Profile (llvm::FoldingSetNodeID &ID) const override
Public Member Functions inherited from clang::ento::PathDiagnosticPiece
| PathDiagnosticPiece ()=delete
| PathDiagnosticPiece (const PathDiagnosticPiece &)=delete
PathDiagnosticPiece & | operator= (const PathDiagnosticPiece &)=delete
virtual | ~PathDiagnosticPiece ()
StringRef | getString () const
void | setTag (const char *tag)
| Tag this PathDiagnosticPiece with the given C-string. More...
const void * | getTag () const
| Return the opaque tag (if any) on the PathDiagnosticPiece. More...
StringRef | getTagStr () const
| Return the string representation of the tag. More...
DisplayHint | getDisplayHint () const
| getDisplayHint - Return a hint indicating where the diagnostic should be displayed by the PathDiagnosticConsumer. More...
Kind | getKind () const
void | addRange (SourceRange R)
void | addRange (SourceLocation B, SourceLocation E)
ArrayRef< SourceRange > | getRanges () const
| Return the SourceRanges associated with this PathDiagnosticPiece. More...
void | setAsLastInMainSourceFile ()
bool | isLastInMainSourceFile () const

## Static Public Member Functions
static bool | classof (const PathDiagnosticPiece *P)
Static Public Member Functions inherited from clang::ento::PathDiagnosticSpotPiece
static bool | classof (const PathDiagnosticPiece *P)

## Additional Inherited Members
Public Types inherited from clang::ento::PathDiagnosticPiece
enum | Kind { ControlFlow, Event, Macro, Call, Note }
enum | DisplayHint { Above, Below }
Protected Member Functions inherited from clang::ento::PathDiagnosticPiece
| PathDiagnosticPiece (StringRef s, Kind k, DisplayHint hint=Below)
| PathDiagnosticPiece (Kind k, DisplayHint hint=Below)

## Detailed Description

Definition at line 532 of file PathDiagnostic.h.

## Constructor & Destructor Documentation

## ◆ PathDiagnosticEventPiece()

clang::ento::PathDiagnosticEventPiece::PathDiagnosticEventPiece | ( | const PathDiagnosticLocation & | pos,
|  | StringRef | s,
|  | bool | addPosRange = `true`,
|  | StackHintGenerator * | stackHint = `nullptr`
| ) |  |
| inline

Definition at line 542 of file PathDiagnostic.h.

## ◆ ~PathDiagnosticEventPiece()

PathDiagnosticEventPiece::~PathDiagnosticEventPiece | ( |  | ) |
| override default

Referenced by StripTrailingDots().

## Member Function Documentation

## ◆ classof()

static bool clang::ento::PathDiagnosticEventPiece::classof | ( | const PathDiagnosticPiece * | P | ) |
| inline static

Definition at line 575 of file PathDiagnostic.h.

References clang::ento::PathDiagnosticPiece::getKind().

## ◆ dump()

LLVM_DUMP_METHOD void PathDiagnosticEventPiece::dump | ( |  | ) | const
| override virtual

Implements clang::ento::PathDiagnosticPiece.

Definition at line 1357 of file PathDiagnostic.cpp.

References clang::ento::PathDiagnosticLocation::dump(), clang::ento::PathDiagnosticSpotPiece::getLocation(), and clang::ento::PathDiagnosticPiece::getString().

## ◆ getCallStackMessage()

std::string clang::ento::PathDiagnosticEventPiece::getCallStackMessage | ( | const ExplodedNode * | N | ) |
| inline

Produce the hint for the given node.

The node contains information about the call for which the diagnostic can be generated.

Definition at line 567 of file PathDiagnostic.h.

References dump().

## ◆ hasCallStackHint()

bool clang::ento::PathDiagnosticEventPiece::hasCallStackHint | ( |  | ) |
| inline

Definition at line 563 of file PathDiagnostic.h.

## ◆ isPrunable()

bool clang::ento::PathDiagnosticEventPiece::isPrunable | ( |  | ) | const
| inline

Return true if the diagnostic piece is prunable.

Definition at line 559 of file PathDiagnostic.h.

## ◆ setPrunable()

void clang::ento::PathDiagnosticEventPiece::setPrunable | ( | bool | isPrunable,
|  | bool | override = `false`
| ) |  |
| inline

Mark the diagnostic piece as being potentially prunable.

This flag may have been previously set, at which point it will not be reset unless one specifies to do so.

Definition at line 552 of file PathDiagnostic.h.

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

- include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
- lib/StaticAnalyzer/Core/PathDiagnostic.cpp