clang 20.0.0git
|
The interface that lets the caller handle unsafe buffer usage analysis results by overriding this class's handle... methods. More...
#include "clang/Analysis/Analyses/UnsafeBufferUsage.h"
Public Types | |
using | DebugNote = std::pair< SourceLocation, std::string > |
using | DebugNoteList = std::vector< DebugNote > |
using | DebugNoteByVar = std::map< const VarDecl *, DebugNoteList > |
using | FixItList = llvm::SmallVectorImpl< FixItHint > |
This analyses produces large fixits that are organized into lists of primitive fixits (individual insertions/removals/replacements). | |
Public Member Functions | |
UnsafeBufferUsageHandler ()=default | |
virtual | ~UnsafeBufferUsageHandler ()=default |
virtual void | handleUnsafeOperation (const Stmt *Operation, bool IsRelatedToDecl, ASTContext &Ctx)=0 |
Invoked when an unsafe operation over raw pointers is found. | |
virtual void | handleUnsafeOperationInContainer (const Stmt *Operation, bool IsRelatedToDecl, ASTContext &Ctx)=0 |
Invoked when an unsafe operation with a std container is found. | |
virtual void | handleUnsafeVariableGroup (const VarDecl *Variable, const VariableGroupsManager &VarGrpMgr, FixItList &&Fixes, const Decl *D, const FixitStrategy &VarTargetTypes)=0 |
Invoked when a fix is suggested against a variable. | |
bool | areDebugNotesRequested () |
void | addDebugNoteForVar (const VarDecl *VD, SourceLocation Loc, std::string Text) |
void | clearDebugNotes () |
virtual bool | isSafeBufferOptOut (const SourceLocation &Loc) const =0 |
virtual bool | ignoreUnsafeBufferInContainer (const SourceLocation &Loc) const =0 |
virtual std::string | getUnsafeBufferUsageAttributeTextAt (SourceLocation Loc, StringRef WSSuffix="") const =0 |
Public Attributes | |
DebugNoteByVar | DebugNotesByVar |
The interface that lets the caller handle unsafe buffer usage analysis results by overriding this class's handle... methods.
Definition at line 84 of file UnsafeBufferUsage.h.
using clang::UnsafeBufferUsageHandler::DebugNote = std::pair<SourceLocation, std::string> |
Definition at line 91 of file UnsafeBufferUsage.h.
using clang::UnsafeBufferUsageHandler::DebugNoteByVar = std::map<const VarDecl *, DebugNoteList> |
Definition at line 93 of file UnsafeBufferUsage.h.
using clang::UnsafeBufferUsageHandler::DebugNoteList = std::vector<DebugNote> |
Definition at line 92 of file UnsafeBufferUsage.h.
This analyses produces large fixits that are organized into lists of primitive fixits (individual insertions/removals/replacements).
Definition at line 103 of file UnsafeBufferUsage.h.
|
default |
|
virtualdefault |
|
inline |
Definition at line 133 of file UnsafeBufferUsage.h.
References areDebugNotesRequested(), DebugNotesByVar, Loc, and Text.
Referenced by clang::checkUnsafeBufferUsage(), and getFixIts().
|
inline |
Definition at line 128 of file UnsafeBufferUsage.h.
Referenced by addDebugNoteForVar(), and clearDebugNotes().
|
inline |
Definition at line 139 of file UnsafeBufferUsage.h.
References areDebugNotesRequested(), and DebugNotesByVar.
Referenced by clang::checkUnsafeBufferUsage().
|
pure virtual |
Referenced by createOverloadsForFixedParams().
|
pure virtual |
Invoked when an unsafe operation over raw pointers is found.
|
pure virtual |
Invoked when an unsafe operation with a std container is found.
|
pure virtual |
Invoked when a fix is suggested against a variable.
This function groups all variables that must be fixed together (i.e their types must be changed to the same target type to prevent type mismatches) into a single fixit.
D
is the declaration of the callable under analysis that owns Variable
and all of its group mates.
Referenced by clang::checkUnsafeBufferUsage().
|
pure virtual |
Loc
; false otherwise.
|
pure virtual |
Loc
; false otherwise. DebugNoteByVar clang::UnsafeBufferUsageHandler::DebugNotesByVar |
Definition at line 94 of file UnsafeBufferUsage.h.
Referenced by addDebugNoteForVar(), and clearDebugNotes().