clang 17.0.0git
Public Types | Public Member Functions | List of all members
clang::UnsafeBufferUsageHandler Class Referenceabstract

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 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)=0
 Invoked when an unsafe operation over raw pointers is found.
 
virtual void handleUnsafeVariableGroup (const VarDecl *Variable, const DefMapTy &VarGrpMap, FixItList &&Fixes)=0
 Invoked when a fix is suggested against a variable.
 
virtual bool isSafeBufferOptOut (const SourceLocation &Loc) const =0
 Returns a reference to the Preprocessor:
 
virtual std::string getUserFillPlaceHolder (StringRef HintTextToUser="placeholder") const
 Returns the text indicating that the user needs to provide input there:
 

Detailed Description

The interface that lets the caller handle unsafe buffer usage analysis results by overriding this class's handle... methods.

Definition at line 26 of file UnsafeBufferUsage.h.

Member Typedef Documentation

◆ FixItList

This analyses produces large fixits that are organized into lists of primitive fixits (individual insertions/removals/replacements).

Definition at line 33 of file UnsafeBufferUsage.h.

Constructor & Destructor Documentation

◆ UnsafeBufferUsageHandler()

clang::UnsafeBufferUsageHandler::UnsafeBufferUsageHandler ( )
default

◆ ~UnsafeBufferUsageHandler()

virtual clang::UnsafeBufferUsageHandler::~UnsafeBufferUsageHandler ( )
virtualdefault

Member Function Documentation

◆ getUserFillPlaceHolder()

virtual std::string clang::UnsafeBufferUsageHandler::getUserFillPlaceHolder ( StringRef  HintTextToUser = "placeholder") const
inlinevirtual

Returns the text indicating that the user needs to provide input there:

Definition at line 51 of file UnsafeBufferUsage.h.

References s.

Referenced by fixVariableWithSpan().

◆ handleUnsafeOperation()

virtual void clang::UnsafeBufferUsageHandler::handleUnsafeOperation ( const Stmt Operation,
bool  IsRelatedToDecl 
)
pure virtual

Invoked when an unsafe operation over raw pointers is found.

Referenced by clang::checkUnsafeBufferUsage().

◆ handleUnsafeVariableGroup()

virtual void clang::UnsafeBufferUsageHandler::handleUnsafeVariableGroup ( const VarDecl Variable,
const DefMapTy VarGrpMap,
FixItList &&  Fixes 
)
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.

Referenced by clang::checkUnsafeBufferUsage().

◆ isSafeBufferOptOut()

virtual bool clang::UnsafeBufferUsageHandler::isSafeBufferOptOut ( const SourceLocation Loc) const
pure virtual

Returns a reference to the Preprocessor:


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