clang 20.0.0git
Static Public Member Functions | List of all members
clang::CloneConstraint Class Reference

This class is a utility class that contains utility functions for building custom constraints. More...

#include "clang/Analysis/CloneDetection.h"

Static Public Member Functions

static void filterGroups (std::vector< CloneDetector::CloneGroup > &CloneGroups, llvm::function_ref< bool(const CloneDetector::CloneGroup &)> Filter)
 Removes all groups by using a filter function.
 
static void splitCloneGroups (std::vector< CloneDetector::CloneGroup > &CloneGroups, llvm::function_ref< bool(const StmtSequence &, const StmtSequence &)> Compare)
 Splits the given CloneGroups until the given Compare function returns true for all clones in a single group.
 

Detailed Description

This class is a utility class that contains utility functions for building custom constraints.

Definition at line 222 of file CloneDetection.h.

Member Function Documentation

◆ filterGroups()

static void clang::CloneConstraint::filterGroups ( std::vector< CloneDetector::CloneGroup > &  CloneGroups,
llvm::function_ref< bool(const CloneDetector::CloneGroup &)>  Filter 
)
inlinestatic

Removes all groups by using a filter function.

Parameters
CloneGroupsThe list of CloneGroups that is supposed to be filtered.
FilterThe filter function that should return true for all groups that should be removed from the list.

Definition at line 229 of file CloneDetection.h.

Referenced by clang::MinComplexityConstraint::constrain(), clang::MinGroupSizeConstraint::constrain(), and clang::FilenamePatternConstraint::constrain().

◆ splitCloneGroups()

void CloneConstraint::splitCloneGroups ( std::vector< CloneDetector::CloneGroup > &  CloneGroups,
llvm::function_ref< bool(const StmtSequence &, const StmtSequence &)>  Compare 
)
static

Splits the given CloneGroups until the given Compare function returns true for all clones in a single group.

Parameters
CloneGroupsA list of CloneGroups that should be modified.
CompareThe comparison function that all clones are supposed to pass. Should return true if and only if two clones belong to the same CloneGroup.

Definition at line 474 of file CloneDetection.cpp.

References c, clang::Prototype, and clang::Result.

Referenced by clang::MatchingVariablePatternConstraint::constrain(), and clang::RecursiveCloneTypeIIVerifyConstraint::constrain().


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